Skip to content
Draft
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
25 changes: 0 additions & 25 deletions internal/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

package astro

import a "golang.org/x/net/html/atom"

// Section 12.2.4.2 of the HTML5 specification says "The following elements
// have varying levels of special parsing rules".
// https://html.spec.whatwg.org/multipage/syntax.html#the-stack-of-open-elements
Expand Down Expand Up @@ -111,26 +109,3 @@ func isSpecialElement(element *Node) bool {
}
return false
}

var knownDirectiveMap = map[string]bool{
"client:load": true,
"client:idle": true,
"client:visible": true,
"client:only": true,
"class:list": true,
"set:text": true,
"set:html": true,
}

func IsKnownDirective(element *Node, attr *Attribute) bool {
if knownDirectiveMap[attr.Key] {
return true
}
if element.DataAtom == a.Script {
return attr.Key == "hoist"
}
if element.DataAtom == a.Style {
return attr.Key == "global"
}
return false
}