-
-
Notifications
You must be signed in to change notification settings - Fork 368
Closed
Labels
remark-parse🐛 type/bugThis is a problemThis is a problem💪 phase/solvedPost is donePost is done🗄 area/interfaceThis affects the public interfaceThis affects the public interface
Description
Subject of the issue
Remark appears to be mishandling text inside square braces, possibly attempting to create a link reference, even though the text in braces is over two lines.
This is hard to describe. I think the reduction below will explain it better.
Your environment
- OS: MacOSX and also reproduced on REPL.it - https://repl.it/repls/RegalHandmadeWifi
- Packages: Latest Remark and Remark-HTML
- Env: Node v12
Steps to reproduce
Run this reduction:
const remark = require('remark');
const html = require('remark-html');
const md = new remark().use(html);
const markdown = `
[one]
[two]
[three]
[four]
[five]
`;
md.process(markdown, (error, result) => {
if (!error) {
console.log(String(result));
}
});
Expected behaviour
Same as what happens on Commonmark Dingus:
<p>[one]
[two]
[three]
[four]
[five]</p>
Actual behaviour
Only every second newline is retained:
<p>[one][two]
[three][four]
[five]</p>
Inside a paragraph this is not a huge deal (although white space is lost there), but inside pre or textarea tags (where this also occurs) this is not desirable.
Metadata
Metadata
Assignees
Labels
remark-parse🐛 type/bugThis is a problemThis is a problem💪 phase/solvedPost is donePost is done🗄 area/interfaceThis affects the public interfaceThis affects the public interface