Closed kelvinsjk closed 7 months ago
Latest commit: 9ee49924341f732be46028beb2f0a76c71057d2f
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Hi, @kelvinsjk
Thanks for the fix. Would you mind sharing a markdown snippet where the unstable code block indentation happens?
The minimal working example I was able to create was the following, with "use-tabs": true"
. Without prettier-plugin-embed enabled the indentation was stable, but after enabling it prettier started adding spaces for indentation after the leading tab.
@kelvinsjk Good catch, I guess that's why prettier has this piece of code of same logic in its built-in embedded markdown formatter: https://github.com/prettier/prettier/blob/1079517b32e5bb145afa7acba448af51f8a7b6e6/src/language-js/embed/markdown.js#L15-L19
Another quick question, do you have any particular reason to also set the last arg of simpleRehydrateDoc
to true
? I actually was thinking about removing this argument and setting it true
for all function calls. But I wonder if there's another specific failing case of embedded markdown
to let you make this change?
Ah, I was blindly mimicking the function call in the sql embedder.ts file 😅
Ah, I was blindly mimicking the function call in the sql embedder.ts file 😅
No worries, I'll keep it. I'll add some comments and a changeset note before merging this. Thanks for your work!
@all-contributors please add @kelvinsjk for code.
@Sec-ant
I couldn't determine any contributions to add, did you specify any contributions? Please make sure to use valid contribution names.
I've put up a pull request to add @kelvinsjk! :tada:
@Sec-ant Thank you!
A big shout out and thanks for all the work on this project!
I was running into the same indentation problems when formatting embedded markdown as seen in #45.
Trying the dedent workaround in #50 in the markdown embeddder fixed the issue for me