0

I have recently started using markdownsharp. 1).... 2)....

The problem is that when I use single return key i.e (\n) then there is no effect. When I do use \n\n then the MarkdownSharp represent it as paragraph tag istead. However, I want the \n to have effect. How does that work then?

user1937198
  • 4,987
  • 4
  • 20
  • 31
Spirals Whirls
  • 543
  • 1
  • 8
  • 27

1 Answers1

3

Markdown intentionally ignores single returns: http://daringfireball.net/projects/markdown/syntax#p

The implication of the “one or more consecutive lines of text” rule is that Markdown supports “hard-wrapped” text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type’s “Convert Line Breaks” option) which translate every line break character in a paragraph into a
tag.

When you do want to insert a
break tag using Markdown, you end a line with two or more spaces, then type return.

So, add two spaces at the end of a line, then hit return and it will be parsed as a
(line break).

  • This is effective. However it's very tricky--code reviewers might ask why there are trailing spaces, and I would have to explain every time, and future maintainers may get confused and delete these spaces... – robbie fan Oct 10 '18 at 02:54