Skip to content

Characters unnecessarily escaped by toString method of XML elements #5645

Closed
@scabug

Description

@scabug

If I generate some Javascript in my Scala code like this:

<script type="text/javascript">
     foo("{bar}");
</script>

and the Javascript contains a double quote character (like in the example), it will appear as {noformat}"{noformat} when the XML is converted into a string by toString, and Firefox will reject this Javascript as having a syntax error.

I don't think it's simply a matter of needing to subsequently replace all of the quot entities with double quotes, either, because some of them might actually need to stay escaped (if they are inside attribute values).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions