markdown2confluence icon indicating copy to clipboard operation
markdown2confluence copied to clipboard

Single newlines are passed through, are interpreted as hard newlines by Confluence

Open orospakr opened this issue 13 years ago • 1 comments

In markdown, you can use newlines to do manual word wrapping (handy with M-q in emacs) and it does not consider them a new paragraph. Ie., Markdown considers double-newlines to be paragraph delimiters. See http://daringfireball.net/projects/markdown/syntax#p.

However, Confluence interprets single newlines into <br>s and markdown2confluence passes them right through, meaning that your paragraphs display in Confluence peppered with <br>s.

Instead, markdown2confluence It should strip out single newlines.

orospakr avatar Aug 15 '12 21:08 orospakr

Note that __\n (double space followed by new-line) should result in <br>.

Proposed parsing:

  1. Split by \s*\n\s*\n\s*; get back a list of paragraphs.
  2. Split by \s\s+\n\s*; get back a list of explicitly broken lines.

This ignores all other syntactic features, in particular code blocks.

reitzig avatar Jan 19 '17 09:01 reitzig