-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ attempt to introduce html in notifications #359
Conversation
acidjazz
commented
Jun 28, 2023
![image](https://private-user-images.githubusercontent.com/967369/249316076-2b97de37-7071-4d62-894c-9b0c5b0b5ecb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NTU3OTEsIm5iZiI6MTczOTU1NTQ5MSwicGF0aCI6Ii85NjczNjkvMjQ5MzE2MDc2LTJiOTdkZTM3LTcwNzEtNGQ2Mi04OTRjLTliMGM1YjBiNWVjYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNFQxNzUxMzFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01Y2JhODEwNDU0NmY3NjZjZWUyZTNmZDg1YWZmYjVmZWZiMWVkOWYyMzVkMjY3ZjNhNzczNjliNGY5ZDEwNGU3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.GpMQ01iTVIkxgjpIAv0Jj8InZg1nJKN0cwat508XyJQ)
✅ Live Preview ready!
|
@acidjazz is attempting to deploy a commit to the Nuxt Labs Team on Vercel. A member of the Team first needs to authorize it. |
What about using slot rather than v-html ? |
Can I get an example? I'd like to be able to make this programmatic |
<p :class="ui.title" v-html="title" /> | ||
<p v-if="description" :class="ui.description" v-html="description" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@acidjazz that's what I mean
<slot>
<p :class="ui.title">
{{ title }}
</p>
<p v-if="description" :class="ui.description">
{{ description }}
</p>
</slot>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Haythamasalama I see, thanks for the example, how would this work programmatically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<UNotification>
<p>
// your title
</p>
<p>
// your description
</p>
</UNotification>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no I mean using the composable useToast().add
here
Hello @acidjazz , Thanks for contributing. v-html ( Security Concern )
QuestionShould we sanitize the html ? SuggestionsIt would be nice to see how other UI Libraries are handling this scenario. Ending NoteWhat are your thoughts @benjamincanac on this ? References |
Yea that's a good point, are there any general practices/suggestions/etc out there we can use to properly sanitize this? Or maybe we can only make it maybe like: <u-button html /> then add to our composables: useToast().add({title: 'test<b>ting</b>', html: true}) I can commit this change if that's agreeable, then put a notice/warning in the docs for this option |
I was just thinking, wouldn't it be better to handle Markdown through MDC syntax instead? This would open way more possibilities, although it would require to add |
Need to explore this possibility 👍 |
I think I'm going to attempt the html being a flag/option that they specify for it to happen, w/ the v-html warning. I can also explore a flag/option of markdown that they specify, maybe we can have the dependency be optional based on if they turn it on somehow? |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Here is my take on this: #431. What do you think? |
awesome! - i like that the control that comes w/ adding the slots in |
Closing in favor of #431 |