Repository navigation
Conversation
emilkm
force-pushed
the
extension_inline_code_lang
branch
from
May 4, 2016 20:14
b4fe228 to
30a3394
Compare
| func (options *Html) CodeSpan(out *bytes.Buffer, text []byte) { | ||
| out.WriteString("<code>") | ||
| func (options *Html) CodeSpan(out *bytes.Buffer, text []byte, lang string) { | ||
| if len(lang) > 0 { |
Collaborator
There was a problem hiding this comment.
It's more idiomatic to check that a string is not empty by doing if lang != "" {.
Collaborator
|
I left some inline Go style comments for your reference. However, this PR should first be reviewed (and accepted) at a high level, so you can put off making those changes until later if you wish. I just wanted to post them since they're general Go code review comments. |
emilkm
force-pushed
the
extension_inline_code_lang
branch
from
May 4, 2016 21:08
30a3394 to
c32c24a
Compare
Enables prettier syntax highlighting of inline code with JavaScript libraries like prism.js
Adding a language specifier following the backticks in the markdown source
`def foo(): pass`(python)
will render as (with extension enabled)
<code class="langueage-python">def foo(): pass</code>
and (with extension NOT enabled)
<code>def foo(): pass</code>(python)
Whitespace is allowed between the closing backtick and the language specifier. The following
`def foo(): pass` (python)
will also render to
<code class="langueage-python">def foo(): pass</code>
emilkm
force-pushed
the
extension_inline_code_lang
branch
from
May 4, 2016 21:13
c32c24a to
724433a
Compare
Author
|
Thanks for the comments. I have done the changes. I agree the change to Render interface should not be taken lightly. |
Collaborator
|
Please see discussion at #288, I'd like to postpone taking PRs like this. |
Author
|
No problem. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up from #257
Enables syntax highlighting of inline code with JavaScript libraries like prism.js
Adding a language specifier following the backticks in the markdown source
will render as (with extension enabled)
and (with extension NOT enabled)
Whitespace is allowed between the closing backtick and the language specifier. The following
will also render to