Open DianomiJH opened 1 month ago
I tried to do some debugging in my node_modules, and as far as i could tell the condition on this line:
is returning true as i'd expect
Should be a bug, will look into it, thanks for reporting
I'm by no means an expert here, but i think this is a valid test:
import * as prettier from "prettier";
import { expect, it } from "vitest";
const pluginPath = "dist/index.js";
it("Doesn't add extra indentation to markdown when noEmbeddedMultiLineIndentation is set", async () => {
expect(true).toBe(true);
const code = `
function foo() {
const md = /* markdown */ \`
# Title
## Subtitle
Paragraph
- List
- List
\`
}
`;
const res = await prettier.format(code, {
parser: "babel",
plugins: [pluginPath],
noEmbeddedMultiLineIndentation: ["markdown"],
});
expect(res).toBe(
"function foo() {\n const md = /* markdown */ `\n# Title\n\n## Subtitle\n\nParagraph\n\n- List\n- List\n`;\n}\n",
);
});
Hi!
It's probably a setup issue on my part, but I've been banging my head against a wall with this formatting issue
this is the code i'd expect not to change indentation (added a couple of nested ifs to add indentation):
this is my prettier config:
expected output would be unchanged from the original but this is what I'm seeing:
here's a sandbox link:
https://codesandbox.io/p/devbox/3v7s4t?file=%2Fsrc%2FApp.jsx%3A4%2C1-15%2C2
Thanks!