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

SinglePlusPassThrough with spaces conflicts with LineBreak. #337

Closed
odknt opened this issue Apr 21, 2019 · 3 comments · Fixed by #346
Closed

SinglePlusPassThrough with spaces conflicts with LineBreak. #337

odknt opened this issue Apr 21, 2019 · 3 comments · Fixed by #346
Assignees
Milestone

Comments

@odknt
Copy link
Contributor

odknt commented Apr 21, 2019

I think the below test should be failed.

It("singleplus passthrough with spaces", func() {
actualContent := `+ *hello*, world +`
expectedResult := types.Paragraph{
Attributes: types.ElementAttributes{},
Lines: []types.InlineElements{
{
types.Passthrough{
Kind: types.SinglePlusPassthrough,
Elements: types.InlineElements{
types.StringElement{
Content: " *hello*, world ",
},
},
},
},
},
}
verify(GinkgoT(), expectedResult, actualContent, parser.Entrypoint("DocumentBlock"))
})

If allow contain spaces between plus and contents, parser cannot tell the difference between SinglePlusPassThrough and LineBreak.

asciidoctor parsed + *hello*, world + as follows:

<p>+ <strong>hello</strong>, world<br></p>
@xcoulon
Copy link
Member

xcoulon commented Apr 23, 2019

thanks for opening this issue @odknt I'll take a look at it

@xcoulon xcoulon added this to the v0.3.0 milestone Apr 23, 2019
@xcoulon xcoulon self-assigned this May 8, 2019
xcoulon added a commit to xcoulon/libasciidoc that referenced this issue May 11, 2019
Do not consider content such as `+ foo bar+` or `+foo bar +`
as valid passthrough: no space allowed after opening `+`
or before closing `+` characters.

Fixes bytesparadise#337

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit that referenced this issue May 11, 2019
Do not consider content such as `+ foo bar+` or `+foo bar +`
as valid passthrough: no space allowed after opening `+`
or before closing `+` characters.

Fixes #337

Signed-off-by: Xavier Coulon <[email protected]>
@xcoulon
Copy link
Member

xcoulon commented May 11, 2019

@odknt sorry for the late fix, I was deep into another issue. Please let me know if the fix is OK for you, and feel free to open new issues if you find other bugs ;)

@odknt
Copy link
Contributor Author

odknt commented May 11, 2019

@xcoulon thanks for fixing. 😄

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

Successfully merging a pull request may close this issue.

2 participants