htmlmarkdowndocsify

how to render line breaks to single newlines in docsifiy


I like to write markdown files in VScode and preview the rendered HTML via the MPE (Markdown-preview-enhanced) plugin, where line breaks are simply rendered as newlines in the default settings, and Github Flavored Markdown does the same thing, although I know the standard should be to use more than two spaces plus a line break.

Can I achieve this by modifying index.html

default setting of mpe
mpe_break_on_single_newline
how to modify the index.html to achieve the following
indexhtml


Solution

  • edit the index.html like this

    ...
    <body>
      <div id="app"></div>
      <script>
        window.$docsify = {
          markdown: {
            breaks: true,
            // Other markdown options
          }
        }
      </script>
      <!-- Docsify v4 -->
      <script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
    </body>
    ...