Closed pbodnar closed 2 years ago
So I've done some analysis, feel free to comment / correct me / suggest a solution. ;) I think I can come up with a fix, but I guess it will require a little bit more coding than in the previous fixes, as a good part of the current parsing logic has to be changed probably...
Also found another problem: number of spaces before opening [
is not checked in the lines following right after a link reference definition. So the following is invalidly parsed as 2 definitions instead of 1 definition + 1 code block:
[link]: /bla
[i-am-block-actually]: /foo
Resolved by #160.
Once again, this is a problem found in the
Footnote
s parsing and while such a use is probably pretty rare, it would be good to have this fixed.An example is given within a comment of test/test_block_token.py:
The cause of this problem seems to be that while searching for next footlink definition start (i. e.
[
) within a block of adjacent lines, newlines are not considered at all, so lines containing anything else (like the paragraphsomething1
) are simply skipped from the parsing process.Moreover, when looking at CommonMark spec, it says that:
So in the example test above, only the first line needs to be treated as a link reference definition and all the remaining lines need to be treated as a single paragraph, i. e. as: