Refactor space handling of writers

I went through the issues of goorgeous and picked a few that seemed easy enough
to add (and added some fore as todos for later). That helped a lot and showed
some bugs / edge cases that required changes.

- the org writer wrote a lot of eol spaces and just removed it whenever
  String() was actually called. That worked until now but did not bode with
  rendering an empty headline - by removing ALL eol space we would render "* "
  back as just "*" -> not a headline anymore.
- the html writer had some special handling for line spacing inside paragraphs
  and list items - with the introduction of more blocks we need that handling
  everywhere.
  As browsers / html renderers are nice enough to collapse whitespace (and
  especially collapse "\s*\n" into " ") we can just write out the newlines and
  let the renderer take care of the rest.
This commit is contained in:
Niklas Fasching 2018-12-02 20:58:06 +01:00
parent 0df8bc541b
commit 592be07cfd
6 changed files with 339 additions and 98 deletions

View file

@ -70,6 +70,46 @@ with multiple lines
#+BEGIN_QUOTE
Mongodb is very webscale
#+END_QUOTE
** issues from goorgeous (free test cases, yay!)
*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/29][#29:]] Support verse block
#+BEGIN_VERSE
This
*is*
verse
#+END_VERSE
#+BEGIN_CUSTOM
or even a *totally* /custom/ kind of block
crazy ain't it?
#+END_CUSTOM
*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/47][#47:]] Consecutive ~code~ wrapped text gets joined
either ~this~ or ~that~ foo.
either ~this~
or ~that~ foo.
*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/68][#68]]: Quote block with inline markup
#+BEGIN_QUOTE
[[www.example.com][/this/ *is* _markup_!]]
#+END_QUOTE
*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/77][#77]]: Recognize =code=--- as code plus dash
*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/75][#75]]: Not parsing nested lists correctly
- bullet 1
- sub bullet
*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/78][#78]]: Emphasis at beginning of line
/italics/
Text
/italics/
*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/82][#82]]: Crash on empty headline
****
just a space as title...
*** DONE [[https://github.com/chaseadamsio/goorgeous/issues/84][#84]]: Paragraphs that are not followed by an empty line are not parsed correctly
**** Foo
Foo paragraph.
**** Bar
Bar paragraph
** Footnotes
- normal footnote reference [fn:1]
- further references to the same footnote should not [fn:1] render duplicates in the footnote list