when empty value prop on html tag,razor doc parse error
See original GitHub issue<input name="firstname" type="text" value=""/>
when the prop
value=“”
then razor parse doc is
#nullable disable
WriteLiteral(“"”);
BeginWriteAttribute(“value”, " value="“, 252, “”, 468, 5); WriteAttributeValue(”", 260, “></div>”, 260, 7, true); …
Why are HTML tags parsed into C# code?
Issue Analytics
- State:
- Created 4 months ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How does a HTML parser know when empty element ends
Answer : Yes, HTML parsers have finite list of empty elements. The parser have certain rules for parsing and will ignore the empty...
Read more >[vite:build-html] Unable to parse html in build step #4067
Describe the bug using vite with vite-plugin-string for importing html as strings dev mode works great, but when trying to build for ...
Read more >Ignore attribute when attribute content is invalid #141
This sounds like invalid CSS in your HTML. See 'The parser throws an error'.
Read more >Uncaught TypeError: Cannot read property of null - iDiallo
We want to get the value of an input. var inputVal = document. ... i get the error code cannot read property "options"...
Read more >Razor syntax reference for ASP.NET Core
Razor evaluates C# expressions and renders them in the HTML output. When an @ symbol is followed by a Razor reserved keyword, it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
em…,I am sorry. I recloned RazorEngineCore and tested the issue in the new console program, It was no problem! I should double-check my project. Thank you very much!
at last I found the problem, the TemplateBase.cs file was missing the BeginWriteAttribute() and EndWriteAttribute() methods
because razor is compiled template engine, thats why its really fast
this code works for me, I dont see any issues: