-
Notifications
You must be signed in to change notification settings - Fork 222
Taghelpers do not preserve whitespace around HTML attributes #563
Comments
@kirthik is there a parsing issue here? Or did you expect the spaces to be preserved in the generated HTML? Put another way, did anything fail? |
I was expecting spaces to be preserved in the generated HTML. |
Does Razor attempt to do any preservation of whitespace in a tag? E.g. if I have: <div
foo = "bar"
baz =
"qux"
>whatever</div> Won't it always render <div foo="bar" baz="qux">whatever</div> ? |
I know we now allow it, but does it actually ever get preserved in the rendering? |
When I inspect html source for the razor code above, I see this
not |
Well But same thing for I talked to @dougbu and as far as he knows all whitespace is trimmed when a tag helper is used. This would ultimately be a feature request that we could consider in a future version. |
The feature would be somewhat analogous to preserving how attribute values are quoted in the Note "preserving how attribute values are quoted in the |
No plans to do this without significant feedback |
If I have a taghelper for div tag then my end output for the above razor code would be
<div class="hey">
Related to #123. Looks like tag helpers are not considering spaces surrounding equals.
The text was updated successfully, but these errors were encountered: