How do I preserve casing (lower/upper case of letters?) #213
-
I have this demo here: https://jsbin.com/juxanirera/10/edit?html,output I'm trying to emit |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
You don’t. Casing doesn’t exist in HTML. XY problem. Lots of code, lots of moving parts. I see ember in there even? |
Beta Was this translation helpful? Give feedback.
-
Heya @NullVoxPopuli! 👋 You are trying to process content, ember templates, which break HTML rules (and by extension |
Beta Was this translation helpful? Give feedback.
Heya @NullVoxPopuli! 👋
Sorry you ran into a spot of trouble.
The answer is largely the same as rehypejs/rehype#88 and https://github.com/orgs/remarkjs/discussions/922
rehype
is an HTML parser and formatter/stringifier.HTML is case insensitive, and as such it applies formatting rules which are case insensitive as well.
You are trying to process content, ember templates, which break HTML rules (and by extension
rehype
) in a number of ways.If you want ember specific parsing, you'll want an ember specific parser and stringifier which produces a unist compatible AST https://github.com/syntax-tree/unist to gaurantee if follows all the ember rules.