Skip to content
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

No stripping occurs if the code span contains only spaces #16

Closed
lostenderman opened this issue Dec 12, 2022 · 3 comments
Closed

No stripping occurs if the code span contains only spaces #16

lostenderman opened this issue Dec 12, 2022 · 3 comments

Comments

@lostenderman
Copy link
Owner

See https://spec.commonmark.org/0.30/#example-334

@Witiko
Copy link
Collaborator

Witiko commented Dec 30, 2022

This issue is a duplicate of issue #107.

@lostenderman
Copy link
Owner Author

Not closing after pull #111, example 334 fails.

Spaces are not preserved in the output.

@Witiko
Copy link
Collaborator

Witiko commented Jan 4, 2023

The corresponding unit test is testfiles/CommonMark_0.30/code_spans/007.test:

%   ---RESULT--- "example": 334,
%   
%   <p><code> </code>
%   <code>  </code></p>
%   
%   ---\RESULT---

<<<
` `
`  `
>>>
documentBegin
codeSpan:  
codeSpan:   
documentEnd

Here is the result of running git checkout commonmark; cd tests; ./test.sh "testfiles/CommonMark_0.30/code_spans/007.test":

Testfile testfiles/CommonMark_0.30/code_spans/007.test
  Format templates/plain/
    Template templates/plain/input.tex.m4
      Command luatex                                   --interaction=nonstopmode  test.tex
*** test-expected.log	2023-01-04 01:07:19.506601678 +0100
--- test-actual.log	2023-01-04 01:07:25.656556667 +0100
***************
*** 1,4 ****
  documentBegin
! codeSpan:  
! codeSpan:   
  documentEnd
--- 1,4 ----
  documentBegin
! codeSpan: 
! codeSpan: 
  documentEnd

The issue seems related to the PEG patterns for parsing code spans (1, 2), which use the rules for Gruber's Markdown rather than CommonMark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants