-
Notifications
You must be signed in to change notification settings - Fork 71
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
Hard line breaks parsed incorrectly in version 1.1.0 #172
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
Heya, thanks. I just tested this locally, and looks to be only an issue with the interactive CLI,
you get $ markdown-it test.txt
<p>foo<br />
baz</p> but then with the interactive "mode" I recreate your findings |
Thanks for taking the time to reproduce this. It's odd that it only affects the interactive interface, but it's good that it's less serious than if it affected the core code. I'll have to be careful about testing with the CLI in the future! |
Yeh must just be a weird quirk of the CLI stdin, but I'll see if I can work it out at some point |
I just tried reproducing the test case with a file and received different results to those you show. I receive: $ markdown-it test.md
<p>foo\
baz</p> i.e. the |
to check, what version of markdown-it-py and also perhaps check the encoding of the file (although I'm on a mac as well, so should not be a problem) |
Well, this is odd: on a different Mac I receive the same output you do. There's a difference in Python version 3.7.3 vs. 3.7.4 and macOS version 10.15.7 vs 10.14, and on one machine I've run There's also an odd conflict with pre-commit over $ pip install --upgrade pre-commit
...
Requirement already satisfied: importlib-metadata in /Library/Frameworks/Python.
framework/Versions/3.7/lib/python3.7/site-packages (from pre-commit) (4.0.1)
...
Collecting importlib-metadata
Downloading importlib_metadata-1.7.0-py2.py3-none-any.whl (31 kB)
...
Installing collected packages: importlib-metadata, pre-commit
Attempting uninstall: importlib-metadata
Found existing installation: importlib-metadata 4.0.1
Uninstalling importlib-metadata-4.0.1:
Successfully uninstalled importlib-metadata-4.0.1
...
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
mdformat 0.7.5 requires importlib-metadata>=3.6.0; python_version < "3.10", but you have importlib-metadata 1.7.0 which is incompatible.
Successfully installed importlib-metadata-1.7.0 pre-commit-2.15.0 which, on the machine which gives the same output as you show, I followed with $ pip install --upgrade mdformat
...
Collecting importlib-metadata>=3.6.0
Downloading importlib_metadata-4.8.1-py3-none-any.whl (17 kB)
...
Installing collected packages: importlib-metadata, mdformat
Attempting uninstall: importlib-metadata
WARNING: Ignoring invalid distribution -ip (/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages)
Found existing installation: importlib-metadata 1.7.0
Uninstalling importlib-metadata-1.7.0:
Successfully uninstalled importlib-metadata-1.7.0
...
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
virtualenv 20.0.29 requires importlib-metadata<2,>=0.12; python_version < "3.8", but you have importlib-metadata 4.8.1 which is incompatible.
Successfully installed importlib-metadata-4.8.1 mdformat-0.7.9 I've tried Otherwise, everything checks-out on both: $ markdown-it --version
markdown-it-py [version 1.1.0]
$ file -I test.txt
test.txt: text/plain; charset=us-ascii |
Not sure why virtualenv is pinned to this earlier version, but perhaps try using python 3.8, where importlib-metadata is not required. |
FWIW, I tracked down the problem between machines: trailing white space (invisible!) in the test file on one of the machines originating from, I think, copy-and-paste. The original problem with the CLI remains. |
Describe the problem
I found what I think is a bug with the parsing of hard like breaks https://spec.commonmark.org/0.30/#hard-line-break. Example 634
foo\ baz
should be parsed as
but I receive
The markdown-it demo https://markdown-it.github.io/ produces output consistent with Example 634, so I think this is a bug in markdown-it-py only.
Link to your repository or website
No response
Steps to reproduce
The version of Python you're using
Python 3.7.3
Your operating system
macOS
Versions of your packages
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: