Closed sgpinkus closed 4 years ago
Hi there @sgpinkus!
This is how Markdown works: you’ll get paragraphs, headings, and whatnot with Markdown when going to HTML.
If you’d rather “unwrap” paragraphs, you can write your own plugin (a rehype plugin is probably a good idea), that traverses the tree and replaces p
elements with their children!
Hey.
This is how Markdown works: you’ll get paragraphs, headings, and whatnot with Markdown when going to HTML.
Hard to see the point in it all otherwise. It's just the outer most p tag I didn't want. I pass text with absolutely no markdown markup I expected no HTML markup back. Supposing "hello" is valid HTML as much as <p>hello</p>
is.
If you’d rather “unwrap” paragraphs, you can write your own plugin (a rehype plugin is probably a good idea)
Thanks for the suggestion. I will look into this.
I understand. It’s just: the way it works, to have that outer <p>
🤷♂️ As in, you’ll have it with CommonMark, markdown-it, or here on GitHub (you can use browser dev tools to inspect):
hello
Yields:
hello
Subject of the feature
Option to remove outer p tag.
Describe your issue here. rehype-remark will wrap HTML in a p tag. I want to not have strings wrapped in p tag optionally. I can't find an option for this.
Gives:
Expected behaviour
Explained above.
Alternatives