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

Support for single backtick code blocks #140

Closed
dotstormz opened this issue Oct 23, 2017 · 3 comments
Closed

Support for single backtick code blocks #140

dotstormz opened this issue Oct 23, 2017 · 3 comments

Comments

@dotstormz
Copy link

The code places a single backtick for a code block on a single line, however in the spec I cannot find an example of this. The single backtick is not being interpreted correctly by cebe/markdown as it is expecting 3 backticks.

Can someone please link me to the relevant spec and paragraph that outlines the use of a single backtick is accepted markdown as per this spec? http://spec.commonmark.org/0.27/#fenced-code-blocks

$markdown .= '`' . $pre_content . '`';

@dotstormz dotstormz changed the title Support for single back tick code blocks Support for single backtick code blocks Oct 23, 2017
@andreskrey
Copy link
Contributor

I made that change and we agreed with @colinodell to use single backticks for single lines and three backticks for multiple lines.

#102 (comment)

To be honest I can't find anywhere in the specs that allows this ¯\_(ツ)_/¯

Maybe we should rollback if the aim of the project is to be 100% aligned with the Commonmark spec.

FYI, you're link is outdated. Latest version is 0.28: http://spec.commonmark.org/0.28/

@dotstormz
Copy link
Author

dotstormz commented Oct 23, 2017

@andreskrey No problem I'm sure that my wishes don't need to influence an entire project ;) I just noticed that that particular change wasn't reflected in other libraries such as the cebe/markdown implementation. All good though, that's why we can extend most markdown parsers I guess. Perhaps there could be a configuration option? We would much rather use the official repo than have to fork.

@colinodell
Copy link
Member

Single backticks are valid - these represent inline "code spans": http://spec.commonmark.org/0.28/#code-spans

However, there's nothing in the spec that says a single line of code must (or should) be represented by an inline code span - that's really just a preference we've implemented in #102.

I'm not opposed to making this a configuration option :)

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

3 participants