initial commit

This commit is contained in:
sawka
2024-07-23 13:08:42 -07:00
parent ac8db05230
commit 29db9c1222
5 changed files with 3869 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
This is a fork of part of the golang.org/x/net/html package.
It is not a complete fork as we only want to modify and change https://pkg.go.dev/golang.org/x/net/html#Tokenizer. So this is the minimal amount of code to get html.Tokenizer working.
The reason for the fork is to allow for returning of case-sensitive tag names and attribute names. The current package normalizes the tag names and attribute names by calling (the equivalent of) strings.ToLower on them before returning them to the caller. We made a very small two line change in token.go to remove those ToLower calls. Other changes involve copying enough code from other files to get all the dependencies satisfied and get it compling again.
Why did we not fork the entire package? Because the rest of the html package is a _validating_ html parser and is quite complicated. As the HTML rules can change over time, it would need to be continually updated and synced with the upstream to keep it compliant. As the actual syntax (tokenization rules) of HTML does not change often, this part of the package is likely much more stable.
+2253
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -0,0 +1,5 @@
module github.com/wavetermdev/htmltoken
go 1.22.4
require golang.org/x/net v0.27.0
+2
View File
@@ -0,0 +1,2 @@
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
+1602
View File
File diff suppressed because it is too large Load Diff