canonical / praecepta

Creative Commons Attribution Share Alike 4.0 International
12 stars 20 forks source link

Rule 16 breaks MD parsing #49

Closed SecondSkoll closed 4 months ago

SecondSkoll commented 4 months ago

Not entirely sure why, need to have a better look into it, but rule 16 is currently causing Vale to hang when processing MD documents.

My Vale installation was hanging (on both Ubuntu 24.04 and Windows WSL running 20.04 in WSL2), so I started removing the most recently added rules to see which one might be causing the issue.

Targeting .rst it was functioning fine, but and *.md were both hanging. Removing rule 16 from the set fixed the issue.

Will do some investigation when I have time later this week.

userMaximilian commented 4 months ago

I encountered this problem (or at least a very similar problem) last week.

I think the regular expressions for ``` code blocks are being too 'greedy', resulting in Vale attempting to evaluate occurrences of // and # after the final code block - including within URLs. In addition, the overall time it takes to evaluate each of these occurrences appears to grow exponentially relative to the number of occurrences, leading to the appearance that Vale has frozen when provided with a complex enough Markdown file.

I tried tweaking the regular expressions in the rule file without success, although I didn't spend much time on it.

SecondSkoll commented 4 months ago

Fixed with #52