Skip to content

Formating adds escape backslashes again and again with each run in 0.6.5 #294

@Cielquan

Description

@Cielquan

What version of prettier-plugin-tailwindcss are you using?

v0.6.4

What version of Tailwind CSS are you using?

v3.4.3

What version of Node.js are you using?

v20.12.1

What package manager are you using?

pnpm

What operating system are you using?

Linux / Ubuntu

Reproduction URL

Because the reproduction code is so small I skipped creating a repo. If you want me to I can make one though.

Code at start:

const Test = () => {
  return <div className="after:content-['\2026']" />;
};

Code after 1st run:

const Test = () => {
  return <div className="after:content-['\\2026']" />;
};

Code after 2nd run:

const Test = () => {
  return <div className="after:content-['\\\\2026']" />;
};

Describe your issue

I just updated from 0.5.10 to 0.6.4 and suddenly the backslash in the code snippet above kept multiplying itself(s). Versions 0.6.4, 0.6.3, 0.6.2 are affected. 0.6.1 is ok.

I did not except the backslash(es) for the octal escape sequence to be escaped again and again.

Repro:

  1. Install prettier and plugin
  2. Create file with content from above
  3. Run prettier multiple times and set the backslashes comin in

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