Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's an example of some invalid markdown?

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 it's such a forgiving syntax that everything I've tried so far turns out to be valid markdown! What's an example of some invalid markdown?

like image 683
Simon Avatar asked Jan 20 '11 18:01

Simon


1 Answers

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**

like image 72
Hugoagogo Avatar answered Oct 04 '22 10:10

Hugoagogo