{"action":"opened","issue":{"url":"https://api.github.com/repos/isagalaev/highlight.js/issues/942","labels_url":"https://api.github.com/repos/isagalaev/highlight.js/issues/942/labels{/name}","comments_url":"https://api.github.com/repos/isagalaev/highlight.js/issues/942/comments","events_url":"https://api.github.com/repos/isagalaev/highlight.js/issues/942/events","html_url":"https://github.com/isagalaev/highlight.js/issues/942","id":108064333,"number":942,"title":"highlight.js crashes if language name is undefined","user":{"login":"commenthol","id":2604482,"avatar_url":"https://avatars.githubusercontent.com/u/2604482?v=3","gravatar_id":"","url":"https://api.github.com/users/commenthol","html_url":"https://github.com/commenthol","followers_url":"https://api.github.com/users/commenthol/followers","following_url":"https://api.github.com/users/commenthol/following{/other_user}","gists_url":"https://api.github.com/users/commenthol/gists{/gist_id}","starred_url":"https://api.github.com/users/commenthol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commenthol/subscriptions","organizations_url":"https://api.github.com/users/commenthol/orgs","repos_url":"https://api.github.com/users/commenthol/repos","events_url":"https://api.github.com/users/commenthol/events{/privacy}","received_events_url":"https://api.github.com/users/commenthol/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-24T06:06:57Z","updated_at":"2015-09-24T06:06:57Z","closed_at":null,"body":"Version v8.8.0 constantly causes a crash if highlight.js is used from [marked](https://github.com/chjj/marked)\r\n\r\nPR #913 introduced case insensitive language support. Unfortunately the line https://github.com/isagalaev/highlight.js/commit/63fb207729d881deea45084c15edc9ab8c32f6e3#diff-5d9139cb5fca768116544c986e8c2c8cR653 causes a crash, if `name` is not given.\r\n\r\nThis e.g. happed from [marked](https://github.com/chjj/marked) if a code block does not specify a language. \r\n\r\nI propose to use this line instead:\r\n\r\n````\r\n652 function getLanguage(name) {\r\n653    name = (name || '').toLowerCase();\r\n````"}}