Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
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
15 changes: 8 additions & 7 deletions claat/parser/gdoc/html.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,14 @@ func findBlockParent(hn *html.Node) *html.Node {
return nil
}

// nodeAttr returns node attribute value of the key name.
// Attribute keys are case insensitive.
func nodeAttr(n *html.Node, name string) string {
name = strings.ToLower(name)
for _, a := range n.Attr {
if strings.ToLower(a.Key) == name {
return a.Val
// nodeAttr checks the given node's HTML attributes for the given key.
// The corresponding value is returned, or the empty string if the key is not found.
// Keys are case insensitive.
func nodeAttr(n *html.Node, key string) string {
key = strings.ToLower(key)
for _, attr := range n.Attr {
if strings.ToLower(attr.Key) == key {
return attr.Val
}
}
return ""
Expand Down
Loading