0

Update to 8.0

This commit is contained in:
Rogaboru Kujimoshi
2014-06-08 21:04:39 +04:00
parent 81d0115677
commit a52831ccdb
134 changed files with 10392 additions and 4999 deletions

View File

@@ -5,83 +5,104 @@ Author: John Crepezzi <john.crepezzi@gmail.com>
Website: http://seejohncode.com/
*/
hljs.LANGUAGES['markdown'] = function(hljs) {
function(hljs) {
return {
case_insensitive: true,
defaultMode: {
contains: [
// highlight headers
{
className: 'header',
begin: '^#{1,3}', end: '$'
},
{
className: 'header',
begin: '^.+?\\n[=-]{2,}$'
},
// inline html
{
begin: '<', end: '>',
subLanguage: 'xml',
relevance: 0
},
// lists (indicators only)
{
className: 'bullet',
begin: '^([*+-]|(\\d+\\.))\\s+'
},
// strong segments
{
className: 'strong',
begin: '[*_]{2}.+?[*_]{2}'
},
// emphasis segments
{
className: 'emphasis',
begin: '\\*.+?\\*'
},
{
className: 'emphasis',
begin: '_.+?_',
relevance: 0
},
// blockquotes
{
className: 'blockquote',
begin: '^>\\s+', end: '$'
},
// code snippets
{
className: 'code',
begin: '`.+?`'
},
{
className: 'code',
begin: '^ ', end: '$',
relevance: 0
},
// horizontal rules
{
className: 'horizontal_rule',
begin: '^-{3,}', end: '$'
},
// using links - title and link
{
begin: '\\[.+?\\]\\(.+?\\)',
returnBegin: true,
contains: [
{
className: 'link_label',
begin: '\\[.+\\]'
},
{
className: 'link_url',
begin: '\\(', end: '\\)',
excludeBegin: true, excludeEnd: true
}
]
}
]
}
aliases: ['md', 'mkdown', 'mkd'],
contains: [
// highlight headers
{
className: 'header',
variants: [
{ begin: '^#{1,6}', end: '$' },
{ begin: '^.+?\\n[=-]{2,}$' }
]
},
// inline html
{
begin: '<', end: '>',
subLanguage: 'xml',
relevance: 0
},
// lists (indicators only)
{
className: 'bullet',
begin: '^([*+-]|(\\d+\\.))\\s+'
},
// strong segments
{
className: 'strong',
begin: '[*_]{2}.+?[*_]{2}'
},
// emphasis segments
{
className: 'emphasis',
variants: [
{ begin: '\\*.+?\\*' },
{ begin: '_.+?_'
, relevance: 0
}
]
},
// blockquotes
{
className: 'blockquote',
begin: '^>\\s+', end: '$'
},
// code snippets
{
className: 'code',
variants: [
{ begin: '`.+?`' },
{ begin: '^( {4}|\t)', end: '$'
, relevance: 0
}
]
},
// horizontal rules
{
className: 'horizontal_rule',
begin: '^[-\\*]{3,}', end: '$'
},
// using links - title and link
{
begin: '\\[.+?\\][\\(\\[].+?[\\)\\]]',
returnBegin: true,
contains: [
{
className: 'link_label',
begin: '\\[', end: '\\]',
excludeBegin: true,
returnEnd: true,
relevance: 0
},
{
className: 'link_url',
begin: '\\]\\(', end: '\\)',
excludeBegin: true, excludeEnd: true
},
{
className: 'link_reference',
begin: '\\]\\[', end: '\\]',
excludeBegin: true, excludeEnd: true
}
],
relevance: 10
},
{
begin: '^\\[\.+\\]:', end: '$',
returnBegin: true,
contains: [
{
className: 'link_reference',
begin: '\\[', end: '\\]',
excludeBegin: true, excludeEnd: true
},
{
className: 'link_url',
begin: '\\s', end: '$'
}
]
}
]
};
}(hljs);
}