RedCloth master generates a spurios
undumbered list is followed by three or more newlines.
RedCloth.new("* one\n* two\n* three \n\n\n").to_html
#=>
“
- \n\t
- one \n\t
- two \n\t
- three \n
note extra trailing
A colleague generated a pull request with a new rspec test that exposes
this bug:
I checked and the bug is present on master.
I just took a look at the ragel code but it’s been quite a while since
I’ve used ragel and it’s not quite as easy to parse as
Ruby
Seems like li_open in lib/redcloth/formatters/html.rb is being called
incorrectly when the thrid newline is parsed.
Here are the locations in the code where li_open is referenced:
$ ack --all-types li_open
ext/redcloth_scan/redcloth.h
202: ASET(“type”, “li_open”);
ext/redcloth_scan/RedclothScanService.java
95: ASET(“type”, “li_open”);
lib/redcloth/formatters/html.rb
50: def li_open(opts)
lib/redcloth/formatters/latex.rb
103: def li_open(opts)
ragel/redcloth_scan.java.rl
94: ASET(“type”, “li_open”);
ragel/redcloth_scan.rb.rl
309: ASET(“type”, “li_open”)