-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #466 #467
base: master
Are you sure you want to change the base?
Fix #466 #467
Conversation
Beginnings of a potential fix to erusev#466 – provided this doesn't break anything unexpectedly
…r a new block exists on the current line at a lesser indentation: if so, interupt current block
Seems that the Commonmark reference parser is opting to have block structures that aren't properly indented interrupt the previous block structure (which seems sensible). Rather than to embed the new block structure within the previous (which is what Parsedown is currently doing). These changes should allow the Have had to change the way list indentation is calculated (so that initial whitespace and marker width is taken into account, I don't think its quite per spec yet, so the failed tests are expected until I figure out the best way to do that 😉 The added check:
does fix the #466 (will have to go through the test results now to double check nothing unexpected has broken) |
Okay, so looks like this no longer breaks anything in the Parsedown tests. Not fit for merge yet though, still need to make sure list indents are done correctly. What I've done so far is make sure that an initial list won't have an indentation of zero (which it would do previously) so we can differentiate between a block started within the list, and one started after but alongside the list (lesser indentation level than the content of the list, and should thus interrupt the list). But would still like to make sure the indentation level I'm assigning is moving to something more inline with the commonmark spec. |
Side note @erusev: Merging #423 and #440 would make testing changes against the CommonMark specs significantly easier... 😉 Looks good to me @aidantwoods. Have you checked your changes against the CommonMark tests yet? There might be some related tests that allow us to kill two birds with one stone. 😃 |
…ion for indent match on list start (prevents test 243 breaking)
Oh, and I know you're not really meant to do this in comments anymore, but +1 on merging #423 and #440! 😉 Had to go and download the working CommonMark tests from @PhrozenByte's fork, and then add them in manually to different snapshots of Parsedown to compare the test results |
…ts, but fails a few in native tests. Interesting...
One of the things I'm noticing, is that block interrupts are going to have to be decoupled from being caused by a blank line, e.g. on this fall-through condition which is implied by an interrupt Line 586 in 0172d77
|
I'll need some time to review this. |
Beginnings of a potential fix to #466 – provided this doesn't break anything unexpectedly