Why does remark-stringify remove newlines when I convert heading to paragraphs? #1368
Replies: 2 comments 2 replies
-
@Kenya-West a few suggestions.
|
Beta Was this translation helpful? Give feedback.
-
Your code is pretty messy. It’s hard to understand what’s going on. We have types: it is strongly recommended that you use those types instead of making your own Solving those problems, will solve your problem of newlines. You are replacing a |
Beta Was this translation helpful? Give feedback.
-
I try to create a web app that flattens all the complex Markdown to messengers' syntax they support.
Firstly, I try to map heading syntax to paragraphs.
That causes a bug: newlines are lost for lists, dividers, and other syntax morphemes. How do I keep the newlines?
Text repro
Imagine we have simple pipeline transform markdown into another markdown:
It produces markdown nearly 100% identical (depends on
remark-stringify
settings).But adding a function to transform heading into paragraphs breaks newlines:
Repro
Simple repro: https://stackblitz.com/edit/stackblitz-starters-veapeg?file=src%2Fmain.ts
Beta Was this translation helpful? Give feedback.
All reactions