Update to 8.0
This commit is contained in:
@@ -2,106 +2,106 @@
|
||||
Language: HTML, XML
|
||||
*/
|
||||
|
||||
hljs.LANGUAGES['xml'] = function(hljs) {
|
||||
function(hljs) {
|
||||
var XML_IDENT_RE = '[A-Za-z0-9\\._:-]+';
|
||||
var PHP = {
|
||||
begin: /<\?(php)?(?!\w)/, end: /\?>/,
|
||||
subLanguage: 'php', subLanguageMode: 'continuous'
|
||||
};
|
||||
var TAG_INTERNALS = {
|
||||
endsWithParent: true,
|
||||
illegal: /</,
|
||||
relevance: 0,
|
||||
contains: [
|
||||
PHP,
|
||||
{
|
||||
className: 'attribute',
|
||||
begin: XML_IDENT_RE,
|
||||
relevance: 0
|
||||
},
|
||||
{
|
||||
begin: '="', returnBegin: true, end: '"',
|
||||
contains: [{
|
||||
className: 'value',
|
||||
begin: '"', endsWithParent: true
|
||||
}]
|
||||
},
|
||||
{
|
||||
begin: '=\'', returnBegin: true, end: '\'',
|
||||
contains: [{
|
||||
className: 'value',
|
||||
begin: '\'', endsWithParent: true
|
||||
}]
|
||||
},
|
||||
{
|
||||
begin: '=',
|
||||
contains: [{
|
||||
className: 'value',
|
||||
begin: '[^\\s/>]+'
|
||||
}]
|
||||
relevance: 0,
|
||||
contains: [
|
||||
{
|
||||
className: 'value',
|
||||
variants: [
|
||||
{begin: /"/, end: /"/},
|
||||
{begin: /'/, end: /'/},
|
||||
{begin: /[^\s\/>]+/}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
return {
|
||||
aliases: ['html', 'xhtml', 'rss', 'atom', 'xsl', 'plist'],
|
||||
case_insensitive: true,
|
||||
defaultMode: {
|
||||
contains: [
|
||||
{
|
||||
className: 'pi',
|
||||
begin: '<\\?', end: '\\?>',
|
||||
relevance: 10
|
||||
},
|
||||
{
|
||||
className: 'doctype',
|
||||
begin: '<!DOCTYPE', end: '>',
|
||||
relevance: 10,
|
||||
contains: [{begin: '\\[', end: '\\]'}]
|
||||
},
|
||||
{
|
||||
className: 'comment',
|
||||
begin: '<!--', end: '-->',
|
||||
relevance: 10
|
||||
},
|
||||
{
|
||||
className: 'cdata',
|
||||
begin: '<\\!\\[CDATA\\[', end: '\\]\\]>',
|
||||
relevance: 10
|
||||
},
|
||||
{
|
||||
className: 'tag',
|
||||
/*
|
||||
The lookahead pattern (?=...) ensures that 'begin' only matches
|
||||
'<style' as a single word, followed by a whitespace or an
|
||||
ending braket. The '$' is needed for the lexem to be recognized
|
||||
by hljs.subMode() that tests lexems outside the stream.
|
||||
*/
|
||||
begin: '<style(?=\\s|>|$)', end: '>',
|
||||
keywords: {title: 'style'},
|
||||
contains: [TAG_INTERNALS],
|
||||
starts: {
|
||||
end: '</style>', returnEnd: true,
|
||||
subLanguage: 'css'
|
||||
}
|
||||
},
|
||||
{
|
||||
className: 'tag',
|
||||
// See the comment in the <style tag about the lookahead pattern
|
||||
begin: '<script(?=\\s|>|$)', end: '>',
|
||||
keywords: {title: 'script'},
|
||||
contains: [TAG_INTERNALS],
|
||||
starts: {
|
||||
end: '</script>', returnEnd: true,
|
||||
subLanguage: 'javascript'
|
||||
}
|
||||
},
|
||||
{
|
||||
begin: '<%', end: '%>',
|
||||
subLanguage: 'vbscript'
|
||||
},
|
||||
{
|
||||
className: 'tag',
|
||||
begin: '</?', end: '/?>',
|
||||
contains: [
|
||||
{
|
||||
className: 'title', begin: '[^ />]+'
|
||||
},
|
||||
TAG_INTERNALS
|
||||
]
|
||||
contains: [
|
||||
{
|
||||
className: 'doctype',
|
||||
begin: '<!DOCTYPE', end: '>',
|
||||
relevance: 10,
|
||||
contains: [{begin: '\\[', end: '\\]'}]
|
||||
},
|
||||
{
|
||||
className: 'comment',
|
||||
begin: '<!--', end: '-->',
|
||||
relevance: 10
|
||||
},
|
||||
{
|
||||
className: 'cdata',
|
||||
begin: '<\\!\\[CDATA\\[', end: '\\]\\]>',
|
||||
relevance: 10
|
||||
},
|
||||
{
|
||||
className: 'tag',
|
||||
/*
|
||||
The lookahead pattern (?=...) ensures that 'begin' only matches
|
||||
'<style' as a single word, followed by a whitespace or an
|
||||
ending braket. The '$' is needed for the lexeme to be recognized
|
||||
by hljs.subMode() that tests lexemes outside the stream.
|
||||
*/
|
||||
begin: '<style(?=\\s|>|$)', end: '>',
|
||||
keywords: {title: 'style'},
|
||||
contains: [TAG_INTERNALS],
|
||||
starts: {
|
||||
end: '</style>', returnEnd: true,
|
||||
subLanguage: 'css'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
className: 'tag',
|
||||
// See the comment in the <style tag about the lookahead pattern
|
||||
begin: '<script(?=\\s|>|$)', end: '>',
|
||||
keywords: {title: 'script'},
|
||||
contains: [TAG_INTERNALS],
|
||||
starts: {
|
||||
end: '</script>', returnEnd: true,
|
||||
subLanguage: 'javascript'
|
||||
}
|
||||
},
|
||||
{
|
||||
begin: '<%', end: '%>',
|
||||
subLanguage: 'vbscript'
|
||||
},
|
||||
PHP,
|
||||
{
|
||||
className: 'pi',
|
||||
begin: /<\?\w+/, end: /\?>/,
|
||||
relevance: 10
|
||||
},
|
||||
{
|
||||
className: 'tag',
|
||||
begin: '</?', end: '/?>',
|
||||
contains: [
|
||||
{
|
||||
className: 'title', begin: '[^ /><]+', relevance: 0
|
||||
},
|
||||
TAG_INTERNALS
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
}(hljs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user