What's an example of some invalid markdown?

前端 未结 3 1319
情书的邮戳
情书的邮戳 2021-01-01 20:04

I\'m writing unit tests for a model with an attribute that\'s interpreted as markdown. I\'d like to test that if the markdown is invalid, then the object is invalid - but i

3条回答
  •  鱼传尺愫
    2021-01-01 20:26

    I haven't used markdown extensively but i was under the impression that it is impossible to write "invalid" markdown only markdown that wont do what you want it to. As in instead of throwing an error when it doesn't know what to do it just treats it as plain text.

    On a different path one could probably write a script to try and identify things that the user probably didn't intend, for example if someone entered **test* they probably intended *test* or **test**

提交回复
热议问题