teesloane / firn

Org Mode Static Site Generator
Eclipse Public License 1.0
324 stars 24 forks source link

colon escape at front of line #92

Closed holtzermann17 closed 3 years ago

holtzermann17 commented 3 years ago

: *** this should be escaped into code ... but presently just disappears!

teesloane commented 3 years ago

Interesting... so I didn't know about this syntax. Found it on the org site:

Fixed Width Areas A “fixed-width line” start with a colon character and a whitespace or an end of line. Fixed width areas can contain any number of consecutive fixed-width lines.

Anyway, the parser emits this node:

        {
          "type": "fixed-width",
          "value": ": *** this should be escaped into code\r\n"
        }

So, this should be no problem to add this in to-html in markup.clj. However, what would your expected output be for this feature? I have never used this syntax before and I still don't quite know what it's for or how it would map to html yet.

holtzermann17 commented 3 years ago

@teesloane — the output would be something like this:

<pre>
*** this should be escaped into code
</pre>

So (sorry this is out of context) the formatter should do something like:

(when (and (= (:type map) "fixed-width")
           (= (subs (:value map) 0 1)))
  [:pre (subs (:value map) 1)])
teesloane commented 3 years ago

Closed by https://github.com/theiceshelf/firn/commit/1933082afce607991d7bcaf1539ce84f1cf99a54.