Skip to content
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

Add option to allow html in column names #540

Closed
puehringer opened this issue Jan 26, 2022 · 2 comments
Closed

Add option to allow html in column names #540

puehringer opened this issue Jan 26, 2022 · 2 comments
Assignees
Labels
type: feature New feature or request

Comments

@puehringer
Copy link
Contributor

#480 introduced text sanitization, which makes perfect sense in the default case (especially for values coming from APIs).

Sometimes however one would explicitly want to do that while ensuring it is safe, which includes setting "static" column names, descriptions, ... For example, adding a little info-icon to the column name showing some tooltip is currently not possible:
image

User story

We want to show additional HTML in the column headers (and only the headers, not values, etc. for now). The relevant lines were introduced here: https://github.com/lineupjs/lineupjs/pull/480/files#diff-405214671f4c41381345a91ca70d7dd417bbec1bbcb6db6cdd2406e3268114eaR35-R43
Would it be possible to add an unsafeLabel or htmlLabel property/flag to the column description to explicitly allow HTML (default should remain safe)?

@sgratzl
Copy link
Member

sgratzl commented Jan 26, 2022

what if the user is editing the label? would it then be safe or unsafe?

@sgratzl sgratzl added the type: feature New feature or request label Jan 26, 2022
@puehringer
Copy link
Contributor Author

Good point, I would expect the user to simply see the HTML-string, i.e. when I mark a column as unsafe I am also responsible for disabling the rename (if I want that). If a user adds renames an unsafe column to something containing HTML, it should "execute" that I suppose. That's just my very first idea, I am open to suggestions.

I also noticed that currently something is wrong (possibly because of the ") in https://deploy-preview-480--lineupjs.netlify.app/injection.html:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants