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

Whitelist various inline semantic/formatting tags #306

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/html/pipeline/sanitization_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class SanitizationFilter < Filter
div ins del sup sub p ol ul table thead tbody tfoot blockquote
dl dt dd kbd q samp var hr ruby rt rp li tr td th s strike summary
details caption figure figcaption
abbr bdo cite dfn mark small span time wbr
].freeze,
remove_contents: ['script'].freeze,
attributes: {
Expand Down Expand Up @@ -109,7 +110,7 @@ class SanitizationFilter < Filter
# protocols, and transformers from WHITELIST but with a more locked down
# set of allowed elements.
LIMITED = WHITELIST.merge(
elements: %w[b i strong em a pre code img ins del sup sub p ol ul li]
elements: %w[b i strong em a pre code img ins del sup sub mark abbr p ol ul li]
)

# Strip all HTML tags from the document.
Expand Down