Shoes3 / ebook

An interactive eBook written in Shoes.
2 stars 0 forks source link

Too many blank lines. #13

Open ccoupe opened 7 years ago

ccoupe commented 7 years ago

After a header #, ##, ###.. there are two many lines in the Shoes representation.

Also, one blank line to separate markdown paragraphs often has two Shoes blank lines.

It really shows up using the simple test file, the README.md of the ebook project. blank-lines

IanTrudel commented 7 years ago

The problem seems relatively straightforward: the text from the Markdown is converted to para, which is really a paragraph with its own spacing, so the blank lines also get their own para/paragraph. It comes to reason that our converter should skip altogether those lines. Comment out the para in convert_blank and see if it fixes the problem.

By the way, Kramdown has an interesting approach involving looking into the parse tree using opts[:parent]. It's also possible to look into :index, :prev and :next as you can see here. It's not going to be helpful here but thought you might like to know.

ccoupe commented 7 years ago

Neutering convert_blank does help. There is still an issue with more vertical space than needed when it encounters a header. Thanks.

IanTrudel commented 7 years ago

Comparing Shoes Manual and a simple test program seems pretty close. The spacing always been a tad more for headers. Are you having a different result?

image

image

ccoupe commented 7 years ago

It's acceptable now but it could be tweaked a little bette, for example. Md also goes to six header levels.