Skip to content

Add <mark> to DEFAULT_ALLOWED_TAGS - #180

Merged
flavorjones merged 1 commit into
rails:mainfrom
dogweather:patch-1
Apr 23, 2024
Merged

Add <mark> to DEFAULT_ALLOWED_TAGS#180
flavorjones merged 1 commit into
rails:mainfrom
dogweather:patch-1

Conversation

@dogweather

Copy link
Copy Markdown
Contributor

This is a safe tag and a common use case for sanitize in Rails: It's a semantic tag that's useful when showing search results. Search results can contain user input. Hence, best practice is to run them through sanitize.

E.g., in my code:

sanitize(search_hit_html, tags: %w[mark])

@flavorjones flavorjones left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable to me.

At some point we should audit the differences between Loofah and R::H::S, because Loofah has allowed this tag since v2.0.0 in 2014.

@dogweather

Copy link
Copy Markdown
Contributor Author

Maybe a PR to DRY up the code?

@flavorjones
flavorjones merged commit a105af7 into rails:main Apr 23, 2024
@flavorjones

Copy link
Copy Markdown
Member

@dogweather I want to audit the differences before writing code, I started doing this for attribute in #136 and hope to finish unifying Loofah and R::H::S as much as possible for the next big release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants