Replies: 1 comment
-
I’d do something along these lines: const caseInsensitiveAttributeNames = new Set(['note', 'warning'])
let key
for (key in node.attributes) {
const lower = key.toLowerCase()
if (key !== lower && caseInsensitiveAttributeNames.has(lower)) {
node.attributes[lower] = node.attributes[key]
delete node.attributes[key]
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have the following code which is intended to parse markdown content in a Remark directive. Valid markdown until now has been:
Now I want (and have tried) to add support for the following "less-valid" examples (make it case insensitive):
but I can't make it to work, with the first two examples it works like a charm, for the other ones Note, NoTE and NOTE it does not work, the resulting
node
comes out without any data and I can't find where my issue is. Can I get some ideas?the above code is using from a
ReactMarkdown
component:ShortcodePlugin.ts
Beta Was this translation helpful? Give feedback.
All reactions