Sha256: 3b0ab270770e7565e4b8e4eceef4d92b3c2a1d59b1c2fe427be604fe5c392ec7

Contents?: true

Size: 1.06 KB

Versions: 7

Compression:

Stored size: 1.06 KB

Contents

Prism.languages.twig = {
	'comment': /\{\#[\s\S]*?\#\}/g,
	'tag': {
		pattern: /(\{\{[\s\S]*?\}\}|\{\%[\s\S]*?\%\})/g,
		inside: {
			'ld': {
				pattern: /^(\{\{\-?|\{\%\-?\s*\w+)/,
				inside: {
					'punctuation': /^(\{\{|\{\%)\-?/,
					'keyword': /\w+/
				}
			},
			'rd': {
				pattern: /\-?(\%\}|\}\})$/,
				inside: {
					'punctuation': /.*/
				}
			},
			'string': {
				pattern: /("|')(\\?.)*?\1/g,
				inside: {
					'punctuation': /^('|")|('|")$/g
				}
			},
			'keyword': /\b(if)\b/g,
			'boolean': /\b(true|false|null)\b/g,
			'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,
			'operator': /==|=|\!=|<|>|>=|<=|\+|\-|~|\*|\/|\/\/|%|\*\*|\|/g,
			'space-operator': {
				pattern: /(\s)(\b(not|b\-and|b\-xor|b\-or|and|or|in|matches|starts with|ends with|is)\b|\?|:|\?\:)(?=\s)/g,
				lookbehind: true,
				inside: {
					'operator': /.*/
				}
			},
			'property': /\b[a-zA-Z_][a-zA-Z0-9_]*\b/g,
			'punctuation': /\(|\)|\[\]|\[|\]|\{|\}|\:|\.|,/g
		}
	},

	// The rest can be parsed as HTML
	'other': {
		pattern: /[\s\S]*/,
		inside: Prism.languages.markup
	}
};

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hyhyhy-1.0.0 lib/hyhyhy/structure/_includes/prism/components/prism-twig.js
hyhyhy-0.0.9 lib/hyhyhy/structure/_includes/prism/components/prism-twig.js
hyhyhy-0.0.8 lib/hyhyhy/structure/_includes/prism/components/prism-twig.js
hyhyhy-0.0.7 lib/hyhyhy/structure/_includes/prism/components/prism-twig.js
hyhyhy-0.0.6 lib/hyhyhy/structure/_includes/prism/components/prism-twig.js
hyhyhy-0.0.5 lib/hyhyhy/structure/_includes/prism/components/prism-twig.js
hyhyhy-0.0.4 lib/hyhyhy/structure/_includes/prism/components/prism-twig.js