-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
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
Overly escaping brackets - tickboxes #23
Comments
Do you have |
I added it to pre-commit: - id: mdformat
name: Format Markdown
entry: mdformat # Executable to run, with fixed options
language: python
types: [markdown]
args: [--wrap, '75', --number]
additional_dependencies:
- mdformat-toc
- mdformat-gfm |
I suspect you didn't have the plugin on the first run, so the backslashes were added. Can you try manually removing them and then running mdformat again? |
I did that prior to reporting by doing a "git reset --hard". |
I got the versions:
|
It's not systematic: # Before:
* [ ] Vérifier que les dates de sauvegarde sont récentes (au plus tard le jour précédent pour la plupart des sauvegarde, sauf exceptionnellement les sauvegardes mensuelles ou hebdomadaires).
# After:
- [ ] Vérifier que les dates de sauvegarde sont récentes (au plus tard le
jour précédent pour la plupart des sauvegarde, sauf exceptionnellement
les sauvegardes mensuelles ou hebdomadaires). |
I'm not able to reproduce: foo@bar:~$ python3 -m venv venv
foo@bar:~$ source venv/bin/activate
(venv) foo@bar:~$ pip install mdformat-gfm
Collecting mdformat-gfm
Using cached mdformat_gfm-0.3.5-py3-none-any.whl (4.9 kB)
Collecting markdown-it-py[linkify]
Using cached markdown_it_py-2.0.1-py3-none-any.whl (84 kB)
Collecting mdformat<0.8.0,>=0.7.5
Using cached mdformat-0.7.13-py3-none-any.whl (27 kB)
Collecting mdit-py-plugins<0.4.0,>=0.2.0
Using cached mdit_py_plugins-0.3.0-py3-none-any.whl (43 kB)
Collecting mdformat-tables>=0.4.0
Using cached mdformat_tables-0.4.1-py3-none-any.whl (4.6 kB)
Collecting attrs<22,>=19
Using cached attrs-21.4.0-py2.py3-none-any.whl (60 kB)
Collecting mdurl~=0.1
Using cached mdurl-0.1.0-py3-none-any.whl (11 kB)
Collecting linkify-it-py~=1.0; extra == "linkify"
Using cached linkify_it_py-1.0.3-py3-none-any.whl (19 kB)
Collecting tomli>=1.1.0
Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting importlib-metadata>=3.6.0; python_version < "3.10"
Using cached importlib_metadata-4.11.2-py3-none-any.whl (17 kB)
Collecting uc-micro-py
Using cached uc_micro_py-1.0.1-py3-none-any.whl (6.2 kB)
Collecting zipp>=0.5
Using cached zipp-3.7.0-py3-none-any.whl (5.3 kB)
Installing collected packages: attrs, mdurl, uc-micro-py, linkify-it-py, markdown-it-py, tomli, zipp, importlib-metadata, mdformat, mdit-py-plugins, mdformat-tables, mdformat-gfm
Successfully installed attrs-21.4.0 importlib-metadata-4.11.2 linkify-it-py-1.0.3 markdown-it-py-2.0.1 mdformat-0.7.13 mdformat-gfm-0.3.5 mdformat-tables-0.4.1 mdit-py-plugins-0.3.0 mdurl-0.1.0 tomli-2.0.1 uc-micro-py-1.0.1 zipp-3.7.0
(venv) foo@bar:~$ mdformat --version
mdformat 0.7.13 (mdformat_tables: 0.4.1, mdformat_gfm: 0.3.5)
(venv) foo@bar:~$ printf -- '- [x] Task 1\n- [ ] Task 2\n' > t.md
(venv) foo@bar:~$ cat t.md
- [x] Task 1
- [ ] Task 2
(venv) foo@bar:~$ mdformat t.md
(venv) foo@bar:~$ cat t.md
- [x] Task 1
- [ ] Task 2
(venv) foo@bar:~$ |
I got the culprit: tabs! They can't be pasted in the issue, but you have to replace the spaces between the closing bracket and the text with tabs. Hard to see 👀!
|
Thanks! Have you checked whether that tab is allowed in the GFM spec? If it isn't, then I'm not worried at all. If it is allowed, then this should be an issue in the Markdown parser used, and reported and fixed in https://github.com/executablebooks/mdit-py-plugins |
The renderer does not complain. The specification requires a whitespace character: Tabs are whitespace characters: They are also whitespace characters in CommonMark: |
I added: - repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.13
hooks:
- id: remove-tabs To pre-commit before the mdformat hook to fix the issue. |
Thanks for reporting this. I'm closing this issue in favor of the upstream issue executablebooks/mdit-py-plugins#41 which will be fixed by executablebooks/mdit-py-plugins#42 |
Tickboxes are not part of CommonMark but part of GFM, so I'ld prefer to kee the brackets of tickboxes unchanged:
This is somewhat related to executablebooks/mdformat#112 .
The text was updated successfully, but these errors were encountered: