You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@allura.apache.org by Dave Brondsema <da...@brondsema.net> on 2015/09/11 16:46:10 UTC

Standardizing our markdown, especially fenced code blocks

Markdown didn't originally have a strict spec, but there is one now:
http://commonmark.org/  We differ from this in fenced code blocks:

* Spec says ``` or ~~~ is valid; we only support ~~~~
* Spec says 3+ of those chars is valid; we only support exactly 4 ~s
* Spec says no blank line is necessary before ~~~, but our implementation
requires it

As I've been working on improvements to the new markdown editor (which tries to
comply with the spec, but isn't all the way there yet), these types of
differences are becoming apparent.  When we differ from the editor, the user is
going to see different syntax highlighting than what preview or save gives them.
 So I am thinking we should start trying to move towards CommonMark spec, and
add support for ``` etc.

We do have some customizations like artifact links [#123] that we won't want to
get rid of, of course.  So at some point we may need to write a custom parser on
top of existing CodeMirror markdown parsing, to handle that if we want to.

-- 
Dave Brondsema : dave@brondsema.net
http://www.brondsema.net : personal
http://www.splike.com : programming
              <><