Skip to content

Commit

Permalink
Merge pull request #683 from Infomaniak/add-missing-tags
Browse files Browse the repository at this point in the history
fix: Update tag whitelist
  • Loading branch information
PhilippeWeidmann committed Apr 5, 2023
2 parents 04f7e12 + 371ecd1 commit 334f2b6
Showing 1 changed file with 53 additions and 4 deletions.
57 changes: 53 additions & 4 deletions MailCore/Utils/Whitelist+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,59 @@ extension Whitelist {
static var extendedWhitelist: Whitelist {
do {
let customWhitelist = Whitelist.none()
let allowedTags = ["html", "meta", "title", "style", "center", "head", "a", "b", "blockquote", "br", "caption",
"cite", "code", "col", "colgroup", "dd", "div", "dl", "dt", "em", "h1", "h2", "h3", "h4", "h5",
"h6", "i", "img", "li", "ol", "p", "pre", "q", "small", "span", "strike", "strong", "sub", "sup",
"table", "tbody", "td", "tfoot", "th", "thead", "tr", "u", "ul"]
let allowedTags = [
"a",
"b",
"blockquote",
"body",
"br",
"caption",
"center",
"cite",
"code",
"col",
"colgroup",
"dd",
"div",
"dl",
"dt",
"em",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"head",
"hr",
"html",
"i",
"img",
"li",
"meta",
"ol",
"p",
"pre",
"q",
"small",
"span",
"strike",
"strong",
"style",
"sub",
"sup",
"table",
"tbody",
"td",
"tfoot",
"th",
"thead",
"title",
"tr",
"u",
"ul",
]

for tag in allowedTags {
try customWhitelist.addTags(tag)
try customWhitelist.addAttributes(tag, "style", "width", "height", "class", "align")
Expand Down

0 comments on commit 334f2b6

Please sign in to comment.