Skip to content

Investigate potential issue with verbatim strings in javascript. #187

Description

@cbengtsson

From code-review:

This change makes verbatim-string phrases preserve literal newlines (instead of converting them to the two-character sequence \n). Downstream code that embeds phrase keys into generated JavaScript needs to escape these characters; otherwise a phrase key containing a newline or quote will produce invalid JS. For example, MN.L10n.JavascriptTranslationMiddleware/FileTranslator.cs builds x["{key}"] = ...; for plural phrases without escaping key. Either ensure key is escaped/JSON-encoded there, or keep parser output normalized to a representation that is safe to embed.

See: #186 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions