Open ackava opened 1 month ago
That’s not the job of an AST. No AST persists whitespace. You are trying to do things with parse5 which it can never do. Now, the root question of this question you ask, perhaps there is a solution to that. But I do not know what you want. Please ask what you really really want.
https://astexplorer.net/#/gist/033016ca9df38fea6ac05b61a474df63/74f7e3fff5a4f3771383394151c4a36454399f92
Is there anyway to retain attribute spacing? Check
a
attribute inh1
.Text Nodes contain whitespaces and whitespace can retain correctly.
I know attribute doesn't have prefix/suffix whitespaces in the HTML spec, but it would be of great help to retain space for WYSWYG editors.
When there are multiple attributes specified, we usually indent them one after another.