RobertDober / earmark_parser

The Markdown to AST part of Earmark.
Apache License 2.0
68 stars 26 forks source link

Apply fence lookahead optimisation for top-level code blocks #100

Closed jonatanklosko closed 2 years ago

jonatanklosko commented 2 years ago

The optimisation was introduced in #70 then modified in #79, but with the latter it no longer applies to top-level code blocks (which is primarily what we need), this brings it back.

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build b6d6dc090846f0ff9aefeba44dc524c140fd8255-PR-100


Totals Coverage Status
Change from base Build 76d443cabc650d6d9c0b9a862e9673cec5128b2f: 0.0%
Covered Lines: 791
Relevant Lines: 791

💛 - Coveralls
RobertDober commented 2 years ago

@jonatanklosko thanks for that, I am puzzled I played around with this during my current refactoring and it broke some cases, probably just me, I'll merge this and have a closer look.

jonatanklosko commented 2 years ago

@RobertDober thanks! I realised we can easily test if the optimisation works as expected (#101), so we don't run into the issue again when refactoring :)

josevalim commented 2 years ago

@RobertDober I think when I first added this I also changed some tests, but they were corner cases that were not defined in the spec (iirc).

RobertDober commented 2 years ago

@jonatanklosko and @josevalim thank you both for the code and your insights, I see now why this is ok and what I missunderstood...

Publishing package...
[#########################] 100%
Package published to https://hex.pm/packages/earmark_parser/1.4.25 (56749c5e1c59447f7b7a23ddb235e4b3defe276afc220a6227237f3efe83f51e)
jonatanklosko commented 2 years ago

@RobertDober fantastic, thanks for releasing so quickly <3