Closed harrytran998 closed 4 years ago
Thanks for the report. This plugin can't do anything to modification by editors/IDEs, since semantic meanings have changed after auto-formatting.
A better solution is to configure VSCode formatter; to avoid trailing \
from recognizing as another table cell. Can you provide the code before formatting, and the formatter you're using?
Thanks for the report. This plugin can't do anything to modification by editors/IDEs, since semantic meanings have changed after auto-formatting. A better solution is to configure VSCode formatter; to avoid trailing
\
from recognizing as another table cell. Can you provide the code before formatting, and the formatter you're using?
Sorry for the reply too late 😅. I'm just using this config:
// Config markdown
"[markdown]": {
"editor.fontFamily": "Menlo, Monaco, 'Courier New', monospace",
"editor.formatOnSave": true
},
And installed plugins: Prettier
and Markdown Shortcuts
of mdickin
Prettier does the markdown auto-formatting. But there's no option for this feature, and I guess they won't add the option in the future.
First, trailing \
is out of most Markdown specs (CommonMark and GFM that prettier adopts; even MultiMarkdown itself). Also, from the docs, no extensions supported; and few options are carefully chosen. It seems no reason for them to break their principle to include an uncommon feature.
Either you can turn to another more expressive formatter, or you can use the workaround that flags the whole paragraph (table) to be ignored:
<!-- prettier-ignore -->
| A1 | A2 | B1 | B2 | C1 | C2 |
| :---------: | :-: | :-: | :-: | :---------------------: | :-: |
| appropriate | a | a | a | - appropriately adv | | \
| | | | | - inappropriate neg adj | |
You can see the playground result here.
@RedBug312 Thanks bro, it's worked! Yeah, and happy new year 🥳!
@RedBug312 , here this format after Vscode automatically formatted:
And this is the result:
But how can use it like your README.md but do not disable VSCode's formatOnSave for markdown file? (Sorry, I'm a newbie)