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.
4.1 KiB
Example org mode file
- Motivation
- Headlines with TODO status, priority & tags
- Lists
- Inline
- blocks
- issues from goorgeous (free test cases, yay!)
- #29: Support verse block
- #47: Consecutive
code
wrapped text gets joined - #68: Quote block with inline markup
- #77: Recognize
code
— as code plus dash - #75: Not parsing nested lists correctly
- #78: Emphasis at beginning of line
- #82: Crash on empty headline
- #84: Paragraphs that are not followed by an empty line are not parsed correctly
- Footnotes
- Footnotes
Motivation
To validate the parser we'll try printing the AST back to org-mode source - if that works we can be kind of sure that the parsing worked. At least I hope so - I would like to get around writing tests for the individual parsing functions…
Headlines with TODO status, priority & tags
TODO [B] Headline with todo status & priority
DONE Headline with TODO status
[A] Headline with tags & priority foo bar
this one is cheating a little as tags are ALWAYS printed right aligned to a given column number…
Lists
- unordered list item 1
-
unordered list item 2 - with
inline
markup-
ordered sublist item 1
- ordered sublist item 1
- ordered sublist item 2
- ordered sublist item 3
- ordered sublist item 2
-
-
unordered list item 3 - and a link and some lines of text
-
and another subitem
echo with a block
-
and another one with a table
a b c 1 2 3 and text with an empty line in between as well!
-
- unordered list item 4
Inline
- emphasis and a hard line break
see? - .emphasis with dot border chars.
- emphasis with a slash/inside
- emphasis followed by raw text with slash /
- ->/not an emphasis/<-
- links with slashes do not become emphasis: https://somelinkshouldntrenderaccidentalemphasis.com/ emphasis
- underlined bold
verbatim
code
strikethrough - bold string with an *asterisk inside
-
links
- regular link https://example.com link without description
- regular link example.com link with description
- regular link to a file (image)
- auto link, i.e. not inside
\[[square brackets]\]
https://www.example.com
blocks
echo a bash source block
a source block without a language
and a second line
and a third one
an example block with multiple lines
Mongodb is very webscale
issues from goorgeous (free test cases, yay!)
DONE #29: Support verse block
This is verse
or even a totally custom kind of block crazy ain't it?
DONE
#47: Consecutive code
wrapped text gets joined
either this
or that
foo.
either this
or that
foo.
DONE #68: Quote block with inline markup
DONE
#77: Recognize code
— as code plus dash
DONE #75: Not parsing nested lists correctly
-
bullet 1
- sub bullet
DONE #78: Emphasis at beginning of line
italics
Text italics
DONE #82: Crash on empty headline
just a space as title…
DONE #84: Paragraphs that are not followed by an empty line are not parsed correctly
Foo
Foo paragraph.
Bar
Bar paragraph