tobijk / caius

A functional testing framework in object-oriented Tcl
MIT License
26 stars 5 forks source link

Markdown: processor hangs indefinitely #12

Closed wduquette closed 9 years ago

wduquette commented 9 years ago

The following input will cause Markdown::convert to hang indefinitely (at least, my variant of the code hangs, and I don't believe I've changed anything that would affect this):

* asterisk 1

* * *

It doesn't seem to matter what character is used as the list bullet. It happens with "*", "+", and "-".

I haven't started looking for a fix for this one; I thought you guys might find it more quickly.

wduquette commented 9 years ago

Ordered lists aren't affected, unsurprisingly.

tobijk commented 9 years ago

: ) I'm afraid this is a can of worms. Just fixing the hanger is not going to be the end of the story. Due to the recursive processing of list element contents, subsequent bullets will also be interpreted as list items, which is obviously wrong. I will need a minute to figure this out.

tobijk commented 9 years ago

Ordered lists are affected:

1. 1. 1. foo
tobijk commented 9 years ago

There is a fix for the hanger in 924e77a8. I'm still pondering, if it's worth adding additional tracking to prevent recursion.

wduquette commented 9 years ago

This fixes my problem, for what it's worth.

tobijk commented 9 years ago

8a262b19 is just slightly better and also prevents recursion on the same line.

tobijk commented 9 years ago

This is fixed in the latest release. Closing.