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

problem with backticks in inline code at the start of a line #23

Closed
lucaswerkmeister opened this issue Feb 4, 2014 · 5 comments · Fixed by #29
Closed

problem with backticks in inline code at the start of a line #23

lucaswerkmeister opened this issue Feb 4, 2014 · 5 comments · Fixed by #29

Comments

@lucaswerkmeister
Copy link

Compare the result of the following markdown (use copy+paste – there’s a difference between 2. and 3.):

foo
`` `class Object` `` is a *meta literal*.
bar
foo
 `` `class Object` `` is a *meta literal*.
bar
foo
 `` `class Object` `` is a *meta literal*.
bar

(that’s a No-Break Space at the beginning of the second line)
4.

foo
other `` `class Object` `` is a *meta literal*.
bar

Here’s how the markdown is rendered by Github:

foo
class Object is a meta literal.
bar

foo
class Object is a meta literal.
bar

foo
class Object is a meta literal.
bar

foo
other class Object is a meta literal.
bar

(The line breaks are incorrect because GFM always inserts line breaks for newlines.)

And here’s how the markdown is rendered by txtmark (as used by ceylon doc):

foo
bar

foo
bar

foo class Object is a meta literal. bar

foo other class Object is a meta literal. bar

That is, if a line starts with nothing other than spaces (meaning the identity of U+0020, not the Unicode category “Separator, Space [Zs]”, which also contains the No-Break Space U+00A0 as seen in 3.) and then a multi-backtick code block containing backticks `code` with backticks`, then strange behavior occurs.

(originally reported as ceylon/ceylon-compiler#1553)

@rjeschke
Copy link
Owner

rjeschke commented Feb 4, 2014

I just tried the code snippets you provided using the latest txtmark, and these are the results:

foo `class Object` is a meta literal. bar

foo `class Object` is a meta literal. bar

foo  `class Object` is a meta literal. bar

foo other `class Object` is a meta literal. bar

which looks fine to me.

Do you have any code changes? Custom emitters? Or do you use the extended profile?

@thradec
Copy link
Contributor

thradec commented Feb 4, 2014

Hi @rjeschke, we use build from commit c0dcd37, we have extended profile enabled and also custom emitters, see.

@rjeschke
Copy link
Owner

rjeschke commented Feb 4, 2014

Ah, it's related to the extended profile and 'fenced code blocks', I'll see what's going on there.

To be exact, it's this line here: https://github.com/rjeschke/txtmark/blob/master/src/main/java/com/github/rjeschke/txtmark/Line.java#L269

I could change the fence line to have consecutive backticks and don't allow any spaces between the starting ones ... don't know if this will break something, though.

@rjeschke
Copy link
Owner

I will add a flag to the Configuration to enable/disable spaces in fenced code blocks. This will allow to fix this issue without destroying compatibility.

@rjeschke
Copy link
Owner

Fixed with a933bf5

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

Successfully merging a pull request may close this issue.

3 participants