The html text following:
<script type="text/javascript">alert(123);</script>
<script>alert(123);</script>
As mentioned above, only part of html text was escaped.
Now, I want to escape the text: <script>alert(123);</script>
.
Expected result:
<script type="text/javascript">alert(123);</script>
<script>alert(123);</script>
I need some help.
There's the EscapeString
function in the html package
import "html"
// ...
unescaped := `<script>alert(123);</script>`
escaped := html.EscapeString(unescaped)