Skip to main content

Line breaks in preview

Completed

Comments

8 comments

  • Fletcher Penney

    Can you give an example?

    0
  • mepelman

    Here is an example: one image is the text in NVUltra (with invisible characters showing) and its preview; the other – preview in Marked.

    0
  • Fletcher Penney

    Brett will have to speak to what Marked is doing with its preview.  My guess is that you have the "Retain linebreaks in paragraphs" preference enabled?

    From what you're showing, the nvUltra preview is correct.  The lines have a single newline in them, which in Markdown does not trigger a line break in the HTML.  If you want a line break, you can use `<space><space><newline>` or `\<newline>` to indicate that you want a linebreak in the output.

    The first option is standard Markdown, and should work anywhere that Markdown is properly supported.  The second option is part of MultiMarkdown, and should also work anywhere that MultiMarkdown is properly supported.

    0
  • mepelman

    Ah, indeed, I do have the setting in Marked enabled. Mystery solved. If the setting makes its way into nvUltra as well, it would be super, but if not, I'll stick with Marked for documents for which the setting makes sense. Thanks.

    0
  • Fletcher Penney

    At least for now, Brett and I are going to stick with the expectation that nvUltra "follows the rules" in terms of Markdown and MultiMarkdown.  So there won't be a preference that goes against the MultiMarkdown syntax, or the Markdown syntax (as implemented in MMD's compatibility mode), such as the "Retain linebreaks in paragraphs" preference that is used in Marked.

    This helps in a couple of ways:

    1. The expected behavior of nvUltra should be clear from the MD/MMD syntax and test suites.  If unexpected behavior arises, it is likely either a bug, or a previously unidentified edge case.
    2. The documents you create with nvUltra should work as expected anywhere that MMD is properly supported, and anywhere that MD is properly supported (assuming you don't use and MMD features).

    There may be specific instances where we need to go against this decision, but hopefully that will be exceedingly rare, if ever.

    0
  • mepelman

    I agree, and there are other preview options for other use cases.

    0
  • Fletcher Penney

    Thanks!

    0
  • Brett

    And you can always use Marked 2 as your external previewer :).

    0

Please sign in to leave a comment.

Powered by Zendesk