Syntax highlighting in annotations #193

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
@shefla

shefla commented Apr 5, 2013

Adds two internal variables highlighter and highlightAuto.
Configures marked to use highlight.js to parse code blocks inside annotations:

marked.setOptions {
    highlight: (code, lang) ->
        if !lang then highlightAuto(code).value
        else
            ext = '.' + lang
            if languages[ext] then lang = languages[ext].name
            highlight(lang, code).value
}
Allow syntax highlighting in annotations
Configure marked to use highlight.js to highlight code blocks inside
annotations.
Also allow to use file extension instead of language name in fenced code
blocks.
@keithamus

This comment has been minimized.

Show comment
Hide comment
@keithamus

keithamus Apr 5, 2013

Collaborator

For some reason the diff is coming out as if everything has changed. Are you perhaps using a Windows machine with text editor that automatically changes line endings? If so please disable this feature or use a different editor.

You can use git commit --amend to amend your commit, then use git push -f to push the new commit up, replacing the old one.

Collaborator

keithamus commented Apr 5, 2013

For some reason the diff is coming out as if everything has changed. Are you perhaps using a Windows machine with text editor that automatically changes line endings? If so please disable this feature or use a different editor.

You can use git commit --amend to amend your commit, then use git push -f to push the new commit up, replacing the old one.

@jashkenas jashkenas closed this Apr 5, 2013

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