-
Notifications
You must be signed in to change notification settings - Fork 41
Case Sensitive Custom Tags #41
Comments
That's a very interesting use-case, I didn't think about it. Is the problem specifically related to having an uppercase first letter? Does it work as expected if you put your tag name in lowercase (on the html-sanitize side of course, it wouldn't work with React)? |
React lets us to create our custom virtual DOM components that contains also Native HTML elements. Actually it's all about separate between Native HTML and JSX of React rules. Here is a simple example:const MyCustomComponent = (props) => (
<strong>
{props.giveMeAWord}
</strong>
);
// Output Component:
export default () => (
<h1>
Hello <MyCustomComponent giveMeAWord="world" />!
<p>Also we could able to use native html content in JSX</p>
</h1>
); As above example, you can see that Native HTML and my custom I have a content parser. It's going to parse raw semi HTML text and to replace raw Yes, i can use lowercase tags like It's kind of complicated. There are many linter rules, JSX rules about case sensitivity. So it's really would be nice that able to use Custom Tag Names, custom attributes. Also the library would be, completely compatible for almost all use cases after that support. Already we just defining our custom logic in our classes. No security conflict for other use cases. |
I'm comfortable with React and JSX, no worry about that :) . My question was more whether the issue in solely related to case sensitivity or not. I'll have a look :) . |
Thank you! I'm looking forward. |
Hello,
Thank you for the amazing library. I was always looking for that kind of library. I think i have found it finally. But when i trying to create my own tags, i'm having a problem. I'm trying to sanitize non-html my custom
React
Components from Front-end. But i just couldn't able to make the library accept like<User id="5" />
fake DOM node. So, i need to create a tag asPascalCase
to make compitable with my React nodes.Is there any way to define case sensitive custom tags? By the way, It would be so nice to have a tricky solution instead of to wait the next release.
Example Code
Thanks,
Mustafa.
The text was updated successfully, but these errors were encountered: