Update to 7.1
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
/*
|
||||
Language: Django
|
||||
Requires: xml.js
|
||||
Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
|
||||
Contributors: Ilya Baryshev <baryshev@gmail.com>
|
||||
*/
|
||||
|
||||
hljs.LANGUAGES.django = function() {
|
||||
hljs.LANGUAGES['django'] = function(hljs) {
|
||||
|
||||
function allowsDjangoSyntax(mode, parent) {
|
||||
return (
|
||||
@@ -18,7 +20,7 @@ hljs.LANGUAGES.django = function() {
|
||||
for (var key in mode) {
|
||||
if (key != 'contains') {
|
||||
result[key] = mode[key];
|
||||
};
|
||||
}
|
||||
var contains = [];
|
||||
for (var i = 0; mode.contains && i < mode.contains.length; i++) {
|
||||
contains.push(copy(mode.contains[i], mode));
|
||||
@@ -36,7 +38,15 @@ hljs.LANGUAGES.django = function() {
|
||||
var FILTER = {
|
||||
className: 'filter',
|
||||
begin: '\\|[A-Za-z]+\\:?', excludeEnd: true,
|
||||
keywords: {'truncatewords': 1, 'removetags': 1, 'linebreaksbr': 1, 'yesno': 1, 'get_digit': 1, 'timesince': 1, 'random': 1, 'striptags': 1, 'filesizeformat': 1, 'escape': 1, 'linebreaks': 1, 'length_is': 1, 'ljust': 1, 'rjust': 1, 'cut': 1, 'urlize': 1, 'fix_ampersands': 1, 'title': 1, 'floatformat': 1, 'capfirst': 1, 'pprint': 1, 'divisibleby': 1, 'add': 1, 'make_list': 1, 'unordered_list': 1, 'urlencode': 1, 'timeuntil': 1, 'urlizetrunc': 1, 'wordcount': 1, 'stringformat': 1, 'linenumbers': 1, 'slice': 1, 'date': 1, 'dictsort': 1, 'dictsortreversed': 1, 'default_if_none': 1, 'pluralize': 1, 'lower': 1, 'join': 1, 'center': 1, 'default': 1, 'truncatewords_html': 1, 'upper': 1, 'length': 1, 'phone2numeric': 1, 'wordwrap': 1, 'time': 1, 'addslashes': 1, 'slugify': 1, 'first': 1},
|
||||
keywords:
|
||||
'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags ' +
|
||||
'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands ' +
|
||||
'title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode ' +
|
||||
'timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort ' +
|
||||
'dictsortreversed default_if_none pluralize lower join center default ' +
|
||||
'truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first ' +
|
||||
'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize ' +
|
||||
'localtime utc timezone',
|
||||
contains: [
|
||||
{className: 'argument', begin: '"', end: '"'}
|
||||
]
|
||||
@@ -54,7 +64,15 @@ hljs.LANGUAGES.django = function() {
|
||||
{
|
||||
className: 'template_tag',
|
||||
begin: '{%', end: '%}',
|
||||
keywords: {'comment': 1, 'endcomment': 1, 'load': 1, 'templatetag': 1, 'ifchanged': 1, 'endifchanged': 1, 'if': 1, 'endif': 1, 'firstof': 1, 'for': 1, 'endfor': 1, 'in': 1, 'ifnotequal': 1, 'endifnotequal': 1, 'widthratio': 1, 'extends': 1, 'include': 1, 'spaceless': 1, 'endspaceless': 1, 'regroup': 1, 'by': 1, 'as': 1, 'ifequal': 1, 'endifequal': 1, 'ssi': 1, 'now': 1, 'with': 1, 'cycle': 1, 'url': 1, 'filter': 1, 'endfilter': 1, 'debug': 1, 'block': 1, 'endblock': 1, 'else': 1},
|
||||
keywords:
|
||||
'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' +
|
||||
'endfor in ifnotequal endifnotequal widthratio extends include spaceless ' +
|
||||
'endspaceless regroup by as ifequal endifequal ssi now with cycle url filter ' +
|
||||
'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' +
|
||||
'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix ' +
|
||||
'plural get_current_language language get_available_languages ' +
|
||||
'get_current_language_bidi get_language_info get_language_info_list localize ' +
|
||||
'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone',
|
||||
contains: [FILTER]
|
||||
},
|
||||
{
|
||||
@@ -69,4 +87,4 @@ hljs.LANGUAGES.django = function() {
|
||||
defaultMode: copy(hljs.LANGUAGES.xml.defaultMode)
|
||||
};
|
||||
|
||||
}();
|
||||
}(hljs);
|
||||
|
||||
Reference in New Issue
Block a user