-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -838,7 +838,7 @@ Parser.prototype.tok = function() { | |
return '<h' | ||
+ this.token.depth | ||
+ ' id="' | ||
+ this.token.text.toLowerCase().replace(/\s/g, '-') | ||
+ this.token.text.toLowerCase().replace(/[^\w]+/g, '-') | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
chjj
Author
Member
|
||
+ '">' | ||
+ this.inline.output(this.token.text) | ||
+ '</h' | ||
|
Why the change? Any non-whitespace character is a valid ID in the HTML5 spec.
If the goal is for HTML4 compliance (which isn't really necessary because the HTML5 behavior is already browser compatible), then we need to also be ensuring the first character is not numeric.