Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Grammars:

- enh(twig) update keywords list
- fix(python) def, class keywords detected mid-identifier (#3381) [Josh Goebel][]
- fix(python) Fix recognition of numeric literals followed by keywords without whitespace (#2985) [Richard Gibson][]
- enh(swift) add SE-0290 unavailability condition (#3382) [Bradley Mackey][]
Expand Down
12 changes: 6 additions & 6 deletions src/languages/twig.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function(hljs) {
begin: '\\(', end: '\\)'
};

var FUNCTION_NAMES = 'attribute block constant cycle date dump include ' +
var FUNCTION_NAMES = 'attribute block constant country_timezones cycle date dump html_classes include ' +
'max min parent random range source template_from_string';

var FUNCTIONS = {
Expand All @@ -28,16 +28,16 @@ export default function(hljs) {
var FILTER = {
begin: /\|[A-Za-z_]+:?/,
keywords:
'abs batch capitalize column convert_encoding date date_modify default ' +
'escape filter first format inky_to_html inline_css join json_encode keys last ' +
'length lower map markdown merge nl2br number_format raw reduce replace ' +
'reverse round slice sort spaceless split striptags title trim upper url_encode',
'abs batch capitalize column convert_encoding country_name currency_name currency_symbol data_uri date date_modify default ' +
'escape filter first format format_currency format_date format_datetime format_number format_time html_to_markdown inky_to_html inline_css join json_encode keys language_name last ' +
'length locale_name lower map markdown markdown_to_html merge nl2br number_format raw reduce replace ' +
'reverse round slice slug sort spaceless split striptags timezone_name title u|0 trim upper url_encode',
contains: [
FUNCTIONS
]
};

var TAGS = 'apply autoescape block deprecated do embed extends filter flush for from ' +
var TAGS = 'apply autoescape block cache deprecated do embed extends filter flush for from ' +
'if import include macro sandbox set use verbatim with';

TAGS = TAGS + ' ' + TAGS.split(' ').map(function(t){return 'end' + t}).join(' ');
Expand Down