{"action":"created","issue":{"url":"https://api.github.com/repos/celsomiranda/hexo-renderer-markdown-it/issues/12","labels_url":"https://api.github.com/repos/celsomiranda/hexo-renderer-markdown-it/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/celsomiranda/hexo-renderer-markdown-it/issues/12/comments","events_url":"https://api.github.com/repos/celsomiranda/hexo-renderer-markdown-it/issues/12/events","html_url":"https://github.com/celsomiranda/hexo-renderer-markdown-it/pull/12","id":77164947,"number":12,"title":"Support for custom syntax highlighting","user":{"login":"dorny","id":1588572,"avatar_url":"https://avatars.githubusercontent.com/u/1588572?v=3","gravatar_id":"","url":"https://api.github.com/users/dorny","html_url":"https://github.com/dorny","followers_url":"https://api.github.com/users/dorny/followers","following_url":"https://api.github.com/users/dorny/following{/other_user}","gists_url":"https://api.github.com/users/dorny/gists{/gist_id}","starred_url":"https://api.github.com/users/dorny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dorny/subscriptions","organizations_url":"https://api.github.com/users/dorny/orgs","repos_url":"https://api.github.com/users/dorny/repos","events_url":"https://api.github.com/users/dorny/events{/privacy}","received_events_url":"https://api.github.com/users/dorny/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/celsomiranda/hexo-renderer-markdown-it/labels/Under%20Review","name":"Under Review","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-05-17T00:14:03Z","updated_at":"2015-05-17T17:14:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/celsomiranda/hexo-renderer-markdown-it/pulls/12","html_url":"https://github.com/celsomiranda/hexo-renderer-markdown-it/pull/12","diff_url":"https://github.com/celsomiranda/hexo-renderer-markdown-it/pull/12.diff","patch_url":"https://github.com/celsomiranda/hexo-renderer-markdown-it/pull/12.patch"},"body":"Hi,\r\n\r\nthis patch will allow user to provide custom function or module for syntax highlighting.\r\nMarkdown-it uses by default [highlightjs](https://highlightjs.org/). It's not bad but there are better solutions, for example [CodeMirror](http://codemirror.net/).\r\n\r\n*API change:*\r\nnew `highlight` option:  must be `function(source, lang) -> string` or name of available module which exports such function.\r\n\r\nFor testing purpose I've added highlighting using codemirror to dev dependencies."},"comment":{"url":"https://api.github.com/repos/celsomiranda/hexo-renderer-markdown-it/issues/comments/102824114","html_url":"https://github.com/celsomiranda/hexo-renderer-markdown-it/pull/12#issuecomment-102824114","issue_url":"https://api.github.com/repos/celsomiranda/hexo-renderer-markdown-it/issues/12","id":102824114,"user":{"login":"dorny","id":1588572,"avatar_url":"https://avatars.githubusercontent.com/u/1588572?v=3","gravatar_id":"","url":"https://api.github.com/users/dorny","html_url":"https://github.com/dorny","followers_url":"https://api.github.com/users/dorny/followers","following_url":"https://api.github.com/users/dorny/following{/other_user}","gists_url":"https://api.github.com/users/dorny/gists{/gist_id}","starred_url":"https://api.github.com/users/dorny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dorny/subscriptions","organizations_url":"https://api.github.com/users/dorny/orgs","repos_url":"https://api.github.com/users/dorny/repos","events_url":"https://api.github.com/users/dorny/events{/privacy}","received_events_url":"https://api.github.com/users/dorny/received_events","type":"User","site_admin":false},"created_at":"2015-05-17T17:14:14Z","updated_at":"2015-05-17T17:14:14Z","body":"Hexo highlighting if enabled takes place even before markdown rendering. It's implemented as filter and replaces all backtick code blocks with marker inside html comment. So if hexo highlighting is enabled your renderer won't get any backtick code block to apply any highlighting. Since html tags in markdown are directly written to output, hexo probably latter replaces all markers with generated html.\r\n\r\nHexo highlighting can be disabled in config and markdown-it itself has an option to supply highlighting function so I would say this patch could be merged as is. At least I will use it this way for now.\r\nWhat do you think?"}}