Skip to content

Commit

Permalink
style: remove trailing spaces / tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
jankal committed Sep 22, 2023
1 parent 0344271 commit b6a0166
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/prism-twig.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function (Prism) {
Prism.languages.twig = {
'comment': /^\{#[\s\S]*?#\}$/,

'tag-name': {
pattern: /(^\{%-?\s*)\w+/,
lookbehind: true,
Expand All @@ -11,7 +11,7 @@
pattern: /^\{[{%]-?|-?[%}]\}$/,
alias: 'punctuation'
},

'string': {
pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
inside: {
Expand All @@ -30,16 +30,16 @@
],
'punctuation': /[()\[\]{}:.,]/
};

Prism.hooks.add('before-tokenize', function (env) {
if (env.language !== 'twig') {
return;
}

var pattern = /\{(?:#[\s\S]*?#|%[\s\S]*?%|\{[\s\S]*?\})\}/g;
Prism.languages['markup-templating'].buildPlaceholders(env, 'twig', pattern);
});

Prism.hooks.add('after-tokenize', function (env) {
Prism.languages['markup-templating'].tokenizePlaceholders(env, 'twig');
});
Expand Down

0 comments on commit b6a0166

Please sign in to comment.