You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,25 @@
1
1
This is a fork of part of the golang.org/x/net/html package.
2
2
3
+
## v0.2.0
4
+
5
+
For v0.2.0 we made a more radical change to the [tokenizer](https://pkg.go.dev/golang.org/x/net/html#Tokenizer) package.
6
+
7
+
We added a new syntax to allow attributes to be set with '{}' syntax.
8
+
Any valid JSON expression is allowed within the curly brackets (this more
9
+
closely matches JSX syntax).
10
+
11
+
```
12
+
<div data-num={5}></div>
13
+
```
14
+
15
+
To support proper decoding in the client, attributes now have a an `IsJson bool` field
16
+
which is set to true if an attribute was parsed with the new {} syntax.
17
+
18
+
If you only need the case-sensitive tokenization for tags/attributes it is
19
+
recommended to use v0.1.0 and not v0.2.0.
20
+
21
+
## v0.1.0
22
+
3
23
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.
4
24
5
25
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.
0 commit comments