We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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):
const markdown = String.raw function getMd() { if (true) { if (true) { return markdown` # Hello **This is some bold text** ` } } }
this is my prettier config:
{ "semi": false, "singleQuote": false, "trailingComma": "all", "plugins": ["prettier-plugin-embed"], "noEmbeddedMultiLineIndentation": ["markdown", "md"] }
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!
The text was updated successfully, but these errors were encountered:
I tried to do some debugging in my node_modules, and as far as i could tell the condition on this line:
prettier-plugin-embed/src/embedded/markdown/embedder.ts
Line 90 in d8b1fae
is returning true as i'd expect
Sorry, something went wrong.
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", ); });
No branches or pull requests
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!
The text was updated successfully, but these errors were encountered: