Skip to content

fmt: literal "\n" (backslash n) within html tagged template incorrectly formatted as "\\n" #30103

@lionel-rowe

Description

@lionel-rowe

Version: Deno 2.4.1

Running deno fmt on the following TS code:

html`\n`;

Gives the following result:

html`
  \\n
`;

Arguably short, single-line html-tagged template inputs shouldn't be formatted at all, but the more serious issue is that \\n is semantically different from \n.

Metadata

Metadata

Assignees

No one assigned

    Labels

    deno fmtRelated to the "deno fmt" subcommand or dprint

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions