-
Notifications
You must be signed in to change notification settings - Fork 879
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
Incorrect space-padding in code span rule #316
Comments
martincizek
added a commit
to orchitech/turndown
that referenced
this issue
Mar 31, 2020
…n more robust for future Turndown development. Fix mixmark-io#316.
martincizek
added a commit
to orchitech/turndown
that referenced
this issue
Apr 1, 2020
…n more robust for future Turndown development. Fix mixmark-io#316.
martincizek
added a commit
to orchitech/turndown
that referenced
this issue
Jul 6, 2020
…n more robust for future Turndown development. Fix mixmark-io#316.
martincizek
added a commit
to orchitech/turndown
that referenced
this issue
Jul 6, 2020
…n more robust for future Turndown development. Fix mixmark-io#316.
martincizek
added a commit
to orchitech/turndown
that referenced
this issue
Jul 6, 2020
…n more robust for future Turndown development. Fix mixmark-io#316.
martincizek
added a commit
to orchitech/turndown
that referenced
this issue
Jul 6, 2020
…n more robust for future Turndown development. Fix mixmark-io#316.
michbart
pushed a commit
to orchitech/turndown
that referenced
this issue
Nov 30, 2020
…n more robust for future Turndown development. Fix mixmark-io#316.
michbart
pushed a commit
to orchitech/turndown
that referenced
this issue
Nov 30, 2020
…n more robust for future Turndown development. Fix mixmark-io#316.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As CommonMark spec 6.3 states, a single space character is removed from the front and back if the string both begins and ends with a space character (shortened).
But
rules.code
adds spaces independently, which means false spaces can be introduced into the resulting code span.The corresponding test is actually expecting a wrong value adding a leading space to code when converted back:
While the right output is:
Also, the current rule is written quite robust in several aspects -
trim()
suggests that whitespace-only content may come in and multiline regexp flag suggests that even newlines may come in. None of that is really relevant in current Turndown, but to keep the rule robust:isBlank
and wasn't trimmed to empty string before.collapse-whitespace.js
before.Disclosure: our next contributions are going to build on this robustness.
The text was updated successfully, but these errors were encountered: