FEATURE: whitelist lang attribute
This commit is contained in:
parent
b76d17881b
commit
0b3d51a8bc
|
@ -136,6 +136,7 @@ const DEFAULT_LIST = [
|
|||
"div.quote-controls",
|
||||
"div.title",
|
||||
"div[align]",
|
||||
"div[lang]",
|
||||
"div[data-*]" /* This may seem a bit much but polls does
|
||||
it anyway and this is needed for themes,
|
||||
special code in sanitizer handles data-*
|
||||
|
@ -170,9 +171,11 @@ const DEFAULT_LIST = [
|
|||
"ol",
|
||||
"ol[start]",
|
||||
"p",
|
||||
"p[lang]",
|
||||
"pre",
|
||||
"s",
|
||||
"small",
|
||||
"span[lang]",
|
||||
"span.excerpt",
|
||||
"span.hashtag",
|
||||
"span.mention",
|
||||
|
|
|
@ -1307,4 +1307,9 @@ HTML
|
|||
expect(cooked).to include("data-theme-a")
|
||||
end
|
||||
|
||||
it "whitelists lang attribute" do
|
||||
cooked = PrettyText.cook("<p lang='fr'>tester</p><div lang='fr'>tester</div><span lang='fr'>tester</span>")
|
||||
expect(cooked).to eq("<p lang=\"fr\">tester</p><div lang=\"fr\">tester</div><span lang=\"fr\">tester</span>")
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue