mirror of
https://github.com/miniflux/v2.git
synced 2025-08-06 17:41:00 +00:00
Change the scope of a variable
This commit is contained in:
parent
fefbf2c935
commit
787d373211
1 changed files with 1 additions and 3 deletions
|
@ -98,6 +98,7 @@ func Sanitize(baseURL, input string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
token := tokenizer.Token()
|
token := tokenizer.Token()
|
||||||
|
tagName := token.DataAtom.String()
|
||||||
switch token.Type {
|
switch token.Type {
|
||||||
case html.TextToken:
|
case html.TextToken:
|
||||||
if len(blockedStack) > 0 {
|
if len(blockedStack) > 0 {
|
||||||
|
@ -112,7 +113,6 @@ func Sanitize(baseURL, input string) string {
|
||||||
|
|
||||||
buffer.WriteString(html.EscapeString(token.Data))
|
buffer.WriteString(html.EscapeString(token.Data))
|
||||||
case html.StartTagToken:
|
case html.StartTagToken:
|
||||||
tagName := token.DataAtom.String()
|
|
||||||
parentTag = tagName
|
parentTag = tagName
|
||||||
|
|
||||||
if isPixelTracker(tagName, token.Attr) {
|
if isPixelTracker(tagName, token.Attr) {
|
||||||
|
@ -135,14 +135,12 @@ func Sanitize(baseURL, input string) string {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case html.EndTagToken:
|
case html.EndTagToken:
|
||||||
tagName := token.DataAtom.String()
|
|
||||||
if len(blockedStack) > 0 && blockedStack[len(blockedStack)-1] == tagName {
|
if len(blockedStack) > 0 && blockedStack[len(blockedStack)-1] == tagName {
|
||||||
blockedStack = blockedStack[:len(blockedStack)-1]
|
blockedStack = blockedStack[:len(blockedStack)-1]
|
||||||
} else if len(blockedStack) == 0 && isValidTag(tagName) && slices.Contains(tagStack, tagName) {
|
} else if len(blockedStack) == 0 && isValidTag(tagName) && slices.Contains(tagStack, tagName) {
|
||||||
buffer.WriteString("</" + tagName + ">")
|
buffer.WriteString("</" + tagName + ">")
|
||||||
}
|
}
|
||||||
case html.SelfClosingTagToken:
|
case html.SelfClosingTagToken:
|
||||||
tagName := token.DataAtom.String()
|
|
||||||
if isPixelTracker(tagName, token.Attr) {
|
if isPixelTracker(tagName, token.Attr) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue