Commit graph

7 commits

Author SHA1 Message Date
Niklas Fasching
adeeb9235d Handle malformed :PROPERTY: drawers
Until now we'd get index out of range errors trying to index into the match if
:PROPERTIES: was followed by a non-property. Thanks fuzz
2019-09-28 15:12:19 +02:00
Niklas Fasching
bd33e8885e Add String() method to Node interface
Being able to very easily get the original [1] Org mode content seems like
something that will come up quite often and is very little code.

[1] it's not really the original content, but rather the pretty printed version
of that - as the semantics don't change it shouldn't matter.
2019-01-06 20:50:02 +01:00
Niklas Fasching
ab9d87fbc8 Clean up regexps 2018-12-20 15:43:16 +01:00
Niklas Fasching
aa42998dbc Add support for headline CUSTOM_ID property & linking
this introduces the PropertyDrawer node to make it easier to access the
properties associated to a headline - normal drawers don't parse their content
into kv pairs
2018-12-19 14:31:07 +01:00
Niklas Fasching
905648c34b org: Fix drawer & block
- drawer entries without value were printed as FOO rather than :FOO:
- account for differences between raw & non-raw block:
  raw blocks are not wrapped in a further element, just raw text & line breaks:
  -> the first line has to be indented manually
  non raw blocks do not end in a linebreak newline -> the END_BLOCK line has to
  be indented (rather they end with a manual newline from another element)
2018-12-19 12:21:25 +01:00
Niklas Fasching
e9d9590d7a Fix drawer parsing
Found thx to trying out
https://github.com/kaushalmodi/ox-hugo/blob/master/test/site/content-org/all-posts.org
- handle properties without value (would normally begin a new drawer)
- handle drawer at eof
2018-12-18 14:17:27 +01:00
Niklas Fasching
0186545123 Add basic support for drawers 2018-12-17 00:01:03 +01:00