hexojs / hexo-renderer-markdown-it

Markdown-it is a Markdown parser, done right. A faster and CommonMark compliant alternative for Hexo.
MIT License
349 stars 60 forks source link

Extra space with 'default' caused by line breaks=false #51

Closed yzlnew closed 4 years ago

yzlnew commented 6 years ago

2017-12-15 8 21 36

Using either marked or markdown-it with breaks=false, and writing markdown files with paragraphs of multi lines causes this issue.

curbengh commented 4 years ago
const md = require('markdown-it')({
  breaks: false
})

console.log(md.render('lorem\nlorem\nlorem'))
<p>lorem
lorem
lorem</p>

Newline \n is displayed as a space in browser. This plugin doesn't trim newlines.