{"action":"closed","issue":{"url":"https://api.github.com/repos/hexojs/hexo/issues/924","labels_url":"https://api.github.com/repos/hexojs/hexo/issues/924/labels{/name}","comments_url":"https://api.github.com/repos/hexojs/hexo/issues/924/comments","events_url":"https://api.github.com/repos/hexojs/hexo/issues/924/events","html_url":"https://github.com/hexojs/hexo/issues/924","id":49342057,"number":924,"title":"Fail to parse markdown, when it contains code blocks with regular expression","user":{"login":"lordfriend","id":1235614,"avatar_url":"https://avatars.githubusercontent.com/u/1235614?v=3","gravatar_id":"","url":"https://api.github.com/users/lordfriend","html_url":"https://github.com/lordfriend","followers_url":"https://api.github.com/users/lordfriend/followers","following_url":"https://api.github.com/users/lordfriend/following{/other_user}","gists_url":"https://api.github.com/users/lordfriend/gists{/gist_id}","starred_url":"https://api.github.com/users/lordfriend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lordfriend/subscriptions","organizations_url":"https://api.github.com/users/lordfriend/orgs","repos_url":"https://api.github.com/users/lordfriend/repos","events_url":"https://api.github.com/users/lordfriend/events{/privacy}","received_events_url":"https://api.github.com/users/lordfriend/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-11-19T07:28:05Z","updated_at":"2015-07-17T08:07:40Z","closed_at":"2015-07-17T08:07:40Z","body":"I have an markdown contain some code blocks like this.\r\n```\r\n```javascript\r\n// prevent {{ }} being parsed by angular\r\n{\r\n  postCompile: function() {\r\n    var match = src.match(/<pre>;[\\s\\S]+?<\\/pre>/mg);\r\n    if(match && match.length > 0) {\r\n      match.forEach(function(str) {\r\n        var subMatch = str.match(/{{[\\s\\S]+?}}/mg);\r\n        var group, newStr = str;\r\n        if(subMatch && subMatch.length > 0) {\r\n          for( var i = 0; i < subMatch.length; i++) {\r\n            group = subMatch[i].match(/{{([\\s\\S]+?)}}/m);\r\n            newStr = newStr.replace(subMatch[i], '<span>{{</span>' + group[1] + '<span>}}</span>');\r\n          }\r\n        }\r\n        src = src.replace(str, newStr);\r\n      });\r\n    }\r\n    return src;\r\n  }\r\n}\r\n```\r\n```\r\n\r\n\r\n When I run hexo server. It failed with the following message.\r\n\r\n\r\n[error] HexoError: Process failed: _posts/Problem-with-document-build-using-grunt-markdown.md\r\nError: Unable to parse \"[\\s\\S]+?\" on line 19 in file /Users/bob/Dropbox/blog/source/_posts/Problem-with-document-build-using-grunt-markdown.md.\r\n    at Object.exports.throwError (/usr/local/lib/node_modules/hexo/node_modules/swig/lib/utils.js:183:9)\r\n    at parseVariable (/usr/local/lib/node_modules/hexo/node_modules/swig/lib/parser.js:489:13)\r\n    at /usr/local/lib/node_modules/hexo/node_modules/swig/lib/parser.js:633:15\r\n    at Object.exports.each (/usr/local/lib/node_modules/hexo/node_modules/swig/lib/utils.js:45:11)\r\n    at Object.exports.parse (/usr/local/lib/node_modules/hexo/node_modules/swig/lib/parser.js:622:9)\r\n    at parse (/usr/local/lib/node_modules/hexo/node_modules/swig/lib/swig.js:343:19)\r\n    at precompile (/usr/local/lib/node_modules/hexo/node_modules/swig/lib/swig.js:473:23)\r\n    at compile (/usr/local/lib/node_modules/hexo/node_modules/swig/lib/swig.js:588:16)\r\n    at Object.render (/usr/local/lib/node_modules/hexo/node_modules/swig/lib/swig.js:507:17)\r\n    at /usr/local/lib/node_modules/hexo/lib/post/render.js:61:29"}}