{"action":"opened","issue":{"url":"https://api.github.com/repos/isagalaev/highlight.js/issues/1293","repository_url":"https://api.github.com/repos/isagalaev/highlight.js","labels_url":"https://api.github.com/repos/isagalaev/highlight.js/issues/1293/labels{/name}","comments_url":"https://api.github.com/repos/isagalaev/highlight.js/issues/1293/comments","events_url":"https://api.github.com/repos/isagalaev/highlight.js/issues/1293/events","html_url":"https://github.com/isagalaev/highlight.js/issues/1293","id":174989286,"number":1293,"title":"So slow regex in less","user":{"login":"Vnthf","id":6292309,"avatar_url":"https://avatars.githubusercontent.com/u/6292309?v=3","gravatar_id":"","url":"https://api.github.com/users/Vnthf","html_url":"https://github.com/Vnthf","followers_url":"https://api.github.com/users/Vnthf/followers","following_url":"https://api.github.com/users/Vnthf/following{/other_user}","gists_url":"https://api.github.com/users/Vnthf/gists{/gist_id}","starred_url":"https://api.github.com/users/Vnthf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vnthf/subscriptions","organizations_url":"https://api.github.com/users/Vnthf/orgs","repos_url":"https://api.github.com/users/Vnthf/repos","events_url":"https://api.github.com/users/Vnthf/events{/privacy}","received_events_url":"https://api.github.com/users/Vnthf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-05T03:30:23Z","updated_at":"2016-09-05T03:30:23Z","closed_at":null,"body":"When I write in codeblock about 3000 length charcters (no spaces, no line break like below), browser is stopped. \r\n```\r\nABCDBDBCBCBDBDBABCDBDBCBCBDBDBABCDBDBCBCBDBDBABCDBDBCBCBDBDBABCDBDBCBCBDBDBABCDBDBCBCBDBDBABCDBDBCBCBDBDBABCDBDBCBCBDBDBABCDBDBCBCBDBDBABCDBDBCBCBDBDBABCD .........\r\n````\r\nso I debugged this issue. I found that less regex is so slow. \r\n\r\n```\r\n/\\/\\/|\\/\\*|@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b|@[\\w-]+\\s*:|@[\\w-]+|([\\w-]+|@{[\\w-]+})\\s*:|[\\.#:&\\[>]|([\\w-]+|@{[\\w-]+})[^;]*{|[=>'\\/<($\"]/gim\r\n```\r\nthis regex spend time about 10000ms.\r\n\r\nI think that ``([\\w-]+|@{[\\w-]+})[^;]*{`` is not correct.\r\n\r\nIt must remove eithor + or *.\r\n\r\nI recommend  ``([\\w-]+|@{[\\w-]+})[^;]{`` .\r\n\r\nless.js\r\n``` \r\nvariants: [{\r\n      begin: '[\\\\.#:&\\\\[>]', end: '[;{}]'  // mixin calls end with ';'\r\n      }, {\r\n      begin: INTERP_IDENT_RE + '[^;]',\r\n      end: '{'\r\n    }],\r\n```\r\n\r\n"}}
{"actor":{"display_login":"Vnthf"}}