-
Notifications
You must be signed in to change notification settings - Fork 4
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
[atable] allow arbitrary HTML in table cells #173
Conversation
Coverage Report for ./atable
File Coverage
|
It is my understanding (though perhaps it is outdated, that Vue's |
@agritheory I tried that as well, and the
|
atable/src/components/ACell.vue
Outdated
v-bind="column.cellComponentProps"> | ||
</component> | ||
v-bind="column.cellComponentProps" /> | ||
<div v-else-if="isHtmlValue" v-html="displayValue" /> |
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.
Is there a way to do this without adding in this extra div
?
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.
Doesn't seem like there's an easy alternative, and someone had asked for one too. Generally you can use the <template>
tag to avoid adding arbitrary elements, but that tag doesn't work with v-html
. I could change it to <span>
to avoid adding block elements though.
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.
Looks good! Thanks for figuring these quirks out
Possible solve for https://github.com/agritheory/autoreader/pull/7.
Concerns:
v-html
directive to render arbitrary HTML strings, but they mention possible security concerns from using it, especially if it can render user-provided input.One possible solution that may solve both the concerns is to automatically disallow editing a cell if it's value is HTML, but that feels too restrictive and may possibly be solved with another modal?
What do you think?