Skip to content

Commit

Permalink
highlight.js 9.15.8 support (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
allejo authored May 31, 2019
2 parents 984fc97 + 4bb7594 commit 2626bf8
Show file tree
Hide file tree
Showing 25 changed files with 94 additions and 10 deletions.
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ Language and style definitions (copied from the highlight.js project)
Sam Wu <[email protected]>
Samuel Reed <[email protected]>
Sean T. Allen <[email protected]>
Sejin Jeon <[email protected]>
Seongwon Lee <[email protected]>
Sergey Baranov <[email protected]>
Sergey Bronnikov <[email protected]>
Expand Down
4 changes: 4 additions & 0 deletions Highlight/Highlighter.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ private function buildSpan($classname, $insideSpan, $leaveOpen = false, $noPrefi

$openSpan .= $classname . "\">";

if (!$classname) {
return $insideSpan;
}

return $openSpan . $insideSpan . $closeSpan;
}

Expand Down
2 changes: 1 addition & 1 deletion Highlight/languages/cpp.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"aliases":["c","cc","h","c++","h++","hpp"],"keywords":{"keyword":"int float while private char catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignof constexpr decltype noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and or not","built_in":"std string cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr","literal":"true false nullptr NULL"},"illegal":"</","contains":[{"className":"keyword","begin":"\\b[a-z\\d_]*_t\\b"},{"className":"comment","begin":"//","end":"$","contains":[{"begin":"\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"},{"className":"doctag","begin":"(?:TODO|FIXME|NOTE|BUG|XXX):","relevance":0}]},{"className":"comment","begin":"/\\*","end":"\\*/","contains":[{"$ref":"#contains.1.contains.0"},{"className":"doctag","begin":"(?:TODO|FIXME|NOTE|BUG|XXX):","relevance":0}]},{"className":"number","variants":[{"begin":"\\b(0b[01']+)"},{"begin":"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{"begin":"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],"relevance":0},{"className":"string","variants":[{"begin":"(u8?|U|L)?\"","end":"\"","illegal":"\\n","contains":[{"begin":"\\\\[\\s\\S]","relevance":0}]},{"begin":"(?:u8?|U|L)?R\"([^()\\\\ ]{0,16})\\((?:.|\\n)*?\\)\\1\""},{"begin":"'\\\\?.","end":"'","illegal":"."}]},{"className":"meta","begin":"#\\s*[a-z]+\\b","end":"$","keywords":{"meta-keyword":"if else elif endif define undef warning error line pragma ifdef ifndef include"},"contains":[{"begin":"\\\\\\n","relevance":0},{"className":"meta-string","variants":{"$ref":"#contains.4.variants"}},{"className":"meta-string","begin":"<[^\\n>]*>","end":"$","illegal":"\\n"},{"$ref":"#contains.1"},{"$ref":"#contains.2"}]},{"begin":"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<","end":">","keywords":{"$ref":"#keywords"},"contains":["self",{"$ref":"#contains.0"}]},{"begin":"[a-zA-Z]\\w*::","keywords":{"$ref":"#keywords"}},{"variants":[{"begin":"=","end":";"},{"begin":"\\(","end":"\\)"},{"beginKeywords":"new throw return else","end":";"}],"keywords":{"$ref":"#keywords"},"contains":[{"$ref":"#contains.0"},{"$ref":"#contains.1"},{"$ref":"#contains.2"},{"$ref":"#contains.3"},{"$ref":"#contains.4"},{"begin":"\\(","end":"\\)","keywords":{"$ref":"#keywords"},"contains":[{"$ref":"#contains.0"},{"$ref":"#contains.1"},{"$ref":"#contains.2"},{"$ref":"#contains.3"},{"$ref":"#contains.4"},"self"],"relevance":0}],"relevance":0},{"className":"function","begin":"([a-zA-Z]\\w*[\\*&\\s]+)+[a-zA-Z]\\w*\\s*\\(","returnBegin":true,"end":"[{;=]","excludeEnd":true,"keywords":{"$ref":"#keywords"},"illegal":"[^\\w\\s\\*&]","contains":[{"begin":"[a-zA-Z]\\w*\\s*\\(","returnBegin":true,"contains":[{"className":"title","begin":"[a-zA-Z]\\w*","relevance":0}],"relevance":0},{"className":"params","begin":"\\(","end":"\\)","keywords":{"$ref":"#keywords"},"relevance":0,"contains":[{"$ref":"#contains.1"},{"$ref":"#contains.2"},{"$ref":"#contains.4"},{"$ref":"#contains.3"},{"$ref":"#contains.0"},{"begin":"\\(","end":"\\)","keywords":{"$ref":"#keywords"},"relevance":0,"contains":["self",{"$ref":"#contains.1"},{"$ref":"#contains.2"},{"$ref":"#contains.4"},{"$ref":"#contains.3"},{"$ref":"#contains.0"}]}]},{"$ref":"#contains.1"},{"$ref":"#contains.2"},{"$ref":"#contains.5"}]},{"className":"class","beginKeywords":"class struct","end":"[{;:]","contains":[{"begin":"<","end":">","contains":["self"]},{"$ref":"#contains.9.contains.0.contains.0"}]}],"exports":{"preprocessor":{"$ref":"#contains.5"},"strings":{"$ref":"#contains.4"},"keywords":{"$ref":"#keywords"}}}
{"aliases":["c","cc","h","c++","h++","hpp","hh","hxx","cxx"],"keywords":{"keyword":"int float while private char catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignof constexpr decltype noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and or not","built_in":"std string cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr","literal":"true false nullptr NULL"},"illegal":"</","contains":[{"className":"keyword","begin":"\\b[a-z\\d_]*_t\\b"},{"className":"comment","begin":"//","end":"$","contains":[{"begin":"\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"},{"className":"doctag","begin":"(?:TODO|FIXME|NOTE|BUG|XXX):","relevance":0}]},{"className":"comment","begin":"/\\*","end":"\\*/","contains":[{"$ref":"#contains.1.contains.0"},{"className":"doctag","begin":"(?:TODO|FIXME|NOTE|BUG|XXX):","relevance":0}]},{"className":"number","variants":[{"begin":"\\b(0b[01']+)"},{"begin":"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{"begin":"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],"relevance":0},{"className":"string","variants":[{"begin":"(u8?|U|L)?\"","end":"\"","illegal":"\\n","contains":[{"begin":"\\\\[\\s\\S]","relevance":0}]},{"begin":"(?:u8?|U|L)?R\"([^()\\\\ ]{0,16})\\((?:.|\\n)*?\\)\\1\""},{"begin":"'\\\\?.","end":"'","illegal":"."}]},{"className":"meta","begin":"#\\s*[a-z]+\\b","end":"$","keywords":{"meta-keyword":"if else elif endif define undef warning error line pragma ifdef ifndef include"},"contains":[{"begin":"\\\\\\n","relevance":0},{"className":"meta-string","variants":{"$ref":"#contains.4.variants"}},{"className":"meta-string","begin":"<[^\\n>]*>","end":"$","illegal":"\\n"},{"$ref":"#contains.1"},{"$ref":"#contains.2"}]},{"begin":"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<","end":">","keywords":{"$ref":"#keywords"},"contains":["self",{"$ref":"#contains.0"}]},{"begin":"[a-zA-Z]\\w*::","keywords":{"$ref":"#keywords"}},{"variants":[{"begin":"=","end":";"},{"begin":"\\(","end":"\\)"},{"beginKeywords":"new throw return else","end":";"}],"keywords":{"$ref":"#keywords"},"contains":[{"$ref":"#contains.0"},{"$ref":"#contains.1"},{"$ref":"#contains.2"},{"$ref":"#contains.3"},{"$ref":"#contains.4"},{"begin":"\\(","end":"\\)","keywords":{"$ref":"#keywords"},"contains":[{"$ref":"#contains.0"},{"$ref":"#contains.1"},{"$ref":"#contains.2"},{"$ref":"#contains.3"},{"$ref":"#contains.4"},"self"],"relevance":0}],"relevance":0},{"className":"function","begin":"([a-zA-Z]\\w*[\\*&\\s]+)+[a-zA-Z]\\w*\\s*\\(","returnBegin":true,"end":"[{;=]","excludeEnd":true,"keywords":{"$ref":"#keywords"},"illegal":"[^\\w\\s\\*&]","contains":[{"begin":"[a-zA-Z]\\w*\\s*\\(","returnBegin":true,"contains":[{"className":"title","begin":"[a-zA-Z]\\w*","relevance":0}],"relevance":0},{"className":"params","begin":"\\(","end":"\\)","keywords":{"$ref":"#keywords"},"relevance":0,"contains":[{"$ref":"#contains.1"},{"$ref":"#contains.2"},{"$ref":"#contains.4"},{"$ref":"#contains.3"},{"$ref":"#contains.0"},{"begin":"\\(","end":"\\)","keywords":{"$ref":"#keywords"},"relevance":0,"contains":["self",{"$ref":"#contains.1"},{"$ref":"#contains.2"},{"$ref":"#contains.4"},{"$ref":"#contains.3"},{"$ref":"#contains.0"}]}]},{"$ref":"#contains.1"},{"$ref":"#contains.2"},{"$ref":"#contains.5"}]},{"className":"class","beginKeywords":"class struct","end":"[{;:]","contains":[{"begin":"<","end":">","contains":["self"]},{"$ref":"#contains.9.contains.0.contains.0"}]}],"exports":{"preprocessor":{"$ref":"#contains.5"},"strings":{"$ref":"#contains.4"},"keywords":{"$ref":"#keywords"}}}
2 changes: 1 addition & 1 deletion Highlight/languages/ini.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"aliases":["toml"],"case_insensitive":true,"illegal":"\\S","contains":[{"className":"comment","begin":";","end":"$","contains":[{"begin":"\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"},{"className":"doctag","begin":"(?:TODO|FIXME|NOTE|BUG|XXX):","relevance":0}]},{"className":"comment","begin":"#","end":"$","contains":[{"$ref":"#contains.0.contains.0"},{"className":"doctag","begin":"(?:TODO|FIXME|NOTE|BUG|XXX):","relevance":0}]},{"className":"section","begin":"^\\s*\\[+","end":"\\]+"},{"begin":"^[a-z0-9\\[\\]_\\.-]+\\s*=\\s*","end":"$","returnBegin":true,"contains":[{"className":"attr","begin":"[a-z0-9\\[\\]_\\.-]+"},{"begin":"=","endsWithParent":true,"relevance":0,"contains":[{"className":"literal","begin":"\\bon|off|true|false|yes|no\\b"},{"className":"variable","variants":[{"begin":"\\$[\\w\\d\"][\\w\\d_]*"},{"begin":"\\$\\{(.*?)}"}]},{"className":"string","contains":[{"begin":"\\\\[\\s\\S]","relevance":0}],"variants":[{"begin":"'''","end":"'''","relevance":10},{"begin":"\"\"\"","end":"\"\"\"","relevance":10},{"begin":"\"","end":"\""},{"begin":"'","end":"'"}]},{"className":"number","begin":"([\\+\\-]+)?[\\d]+_[\\d_]+"},{"className":"number","begin":"\\b\\d+(\\.\\d+)?","relevance":0}]}]}]}
{"aliases":["toml"],"case_insensitive":true,"illegal":"\\S","contains":[{"className":"comment","begin":";","end":"$","contains":[{"begin":"\\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\\b"},{"className":"doctag","begin":"(?:TODO|FIXME|NOTE|BUG|XXX):","relevance":0}]},{"className":"comment","begin":"#","end":"$","contains":[{"$ref":"#contains.0.contains.0"},{"className":"doctag","begin":"(?:TODO|FIXME|NOTE|BUG|XXX):","relevance":0}]},{"className":"section","begin":"^\\s*\\[+","end":"\\]+"},{"begin":"^[a-z0-9\\[\\]_\\.-]+\\s*=\\s*","end":"$","returnBegin":true,"contains":[{"className":"attr","begin":"[a-z0-9\\[\\]_\\.-]+"},{"begin":"=","endsWithParent":true,"relevance":0,"contains":[{"className":"comment","begin":";","end":"$","contains":[{"$ref":"#contains.0.contains.0"},{"className":"doctag","begin":"(?:TODO|FIXME|NOTE|BUG|XXX):","relevance":0}]},{"$ref":"#contains.1"},{"className":"literal","begin":"\\bon|off|true|false|yes|no\\b"},{"className":"variable","variants":[{"begin":"\\$[\\w\\d\"][\\w\\d_]*"},{"begin":"\\$\\{(.*?)}"}]},{"className":"string","contains":[{"begin":"\\\\[\\s\\S]","relevance":0}],"variants":[{"begin":"'''","end":"'''","relevance":10},{"begin":"\"\"\"","end":"\"\"\"","relevance":10},{"begin":"\"","end":"\""},{"begin":"'","end":"'"}]},{"className":"number","begin":"([\\+\\-]+)?[\\d]+_[\\d_]+"},{"className":"number","begin":"\\b\\d+(\\.\\d+)?","relevance":0}]}]}]}
Loading

0 comments on commit 2626bf8

Please sign in to comment.