WebOptimizer
WebOptimizer copied to clipboard
Double @ in <script src=""> causes unexpected bug
Description
When using razor pages, if the script tag contains @@, using the provided tag helper (@addTagHelper *, WebOptimizer.Core) would mess up the code.
Example
<script src="https://unpkg.com/@@barba/core"></script>
Due to @ is a special character in Razor Pages, we need @@ to escape it being interpreted the wrong way.
Expect Output
Excepted in final HTML render:
<script src="https://unpkg.com/@barba/core"></script>
Actual Output
Output in final HTML render:
<script src=" href=" https:="" unpkg.com="" @="" href="barba/core"></script>
Workaround
Force to use @() directly
<script src="@("https://unpkg.com/@barba/core")"></script>