Python-Markdown / markdown

A Python implementation of John Gruber’s Markdown with Extension support.
https://python-markdown.github.io/
BSD 3-Clause "New" or "Revised" License
3.74k stars 858 forks source link

Add test case for large markdown table, add useful debug prints #1377

Closed flynneva closed 1 year ago

flynneva commented 1 year ago

By removing the blank space in the test between the HTML link and the markdown table, the test fails to complete without a very helpful warning / error.

I'd be up for improving the error that is reported if you are, just let me know if this is interesting for the project or not.

Relates to #1374

waylan commented 1 year ago

How does this test fail? My understanding of you previous report was that it simply took a long time for the parser to complete. That's not really the sort of test that makes sense to automate.

Yes, we could alter the code to raise an error, except that is against our policy. See the first goal listed in our homepage. The only way we indicate to a document author that they provided bad input is by outputting unexpected output. That is how all Markdown implementations work.

flynneva commented 1 year ago

@waylan this test fails when you remove the blank line between the link and the table. It passes just fine otherwise.

By having a test with a large table with valid formatting you can point future devs like me who say "does this package support super large tables?" to the test and say yes it does and builds fine. If this test existed when I made my original issue, you could just sent me a link to it and I would've been able to pretty quickly see what's different between the table source in the test and mine (the blank line just before the table).

I'm not saying you have to fix anything or merge this PR if you don't want to - you are the maintainer 😅 I am not.

waylan commented 1 year ago

you can point future devs like me who say "does this package support super large tables?" to the test and say yes it does and builds fine

I'm not likely to do that because I'm not likely to ever recall that such a test case exists. Our tests exist to ensure we don't introduce regressions when we make changes to the code. This test case does not seem to serve that function. Therefore, it is of no value and simply adds to the maintenance burden (it anything). While I appreciate your willingness to contribute, I will not be accepting this contribution.