Skip to content

Question: Parsing Vue-Template Syntax (HTML flavor) #2524

Discussion options

You must be logged in to vote

According to the HTML living standard, attributes without values implicitly have a value of the empty string. So one idea is that you write your own serialization code that does not include the empty string values for attributes.

The algorithm to serialize is more or less straight forward. You could start with this code and modify the code around line 326.

Dealing with case of attributes and tags is harder. The standard says during parsing that all attributes and tag names becomes lowercase. This is true even for attributes in foreign elements (MathML and SVG). (There are separate parsing steps for converting the foreign attributes and tags to their appropriate case, but the specific attr…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@stevecheckoway
Comment options

Answer selected by flavorjones
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants