You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hast-util-raw shouldn't add whitespace lines at the start.
This was discussed in rehypejs/rehype-raw#22 and they decided it wasn't a bug since ordinarily browsers parse it the same, however, when using non-default values of the CSS property white-space (such as pre or pre-wrap) this issue appears.
I'd like newlines the user inputted to be maintained, while also allowing user inputted html to be rendered (yes, I know the security risks).
For example:
Input: Hello World
Output: Hello
World
Input:
Hello
<table><thead><tr><th>Column</th></tr></thead><tbody><tr><td>foo</td></tr><tr><td>bar</td></tr></tbody></table>
World
Initial checklist
Affected packages and versions
9.0.4
Link to runnable example
No response
Steps to reproduce
Expected behavior
hast-util-raw shouldn't add whitespace lines at the start.
This was discussed in rehypejs/rehype-raw#22 and they decided it wasn't a bug since ordinarily browsers parse it the same, however, when using non-default values of the CSS property
white-space
(such aspre
orpre-wrap
) this issue appears.Actual behavior
A text node with whitespace is added:
Affected runtime and version
node@22.5.1
Affected package manager and version
pnpm@9.5.0
Affected OS and version
Arch Linux (Rolling)
Build and bundle tools
No response
The text was updated successfully, but these errors were encountered: