Sha256: ac949b3fd8bc1486ce5a4bab241e74264afbd4333b83032719c35139ef53e853

Contents?: true

Size: 806 Bytes

Versions: 7

Compression:

Stored size: 806 Bytes

Contents

Prism.languages.bash = Prism.languages.extend('clike', {
	'comment': {
		pattern: /(^|[^"{\\])(#.*?(\r?\n|$))/g,
		lookbehind: true
	},
	'string': {
		//allow multiline string
		pattern: /("|')(\\?[\s\S])*?\1/g,
		inside: {
			//'property' class reused for bash variables
			'property': /\$([a-zA-Z0-9_#\?\-\*!@]+|\{[^\}]+\})/g
		}
	},
	'keyword': /\b(if|then|else|elif|fi|for|break|continue|while|in|case|function|select|do|done|until|echo|exit|return|set|declare)\b/g
});

Prism.languages.insertBefore('bash', 'keyword', {
	//'property' class reused for bash variables
	'property': /\$([a-zA-Z0-9_#\?\-\*!@]+|\{[^}]+\})/g
});
Prism.languages.insertBefore('bash', 'comment', {
	//shebang must be before comment, 'important' class from css reused
	'important': /(^#!\s*\/bin\/bash)|(^#!\s*\/bin\/sh)/g
});

Version data entries

7 entries across 7 versions & 1 rubygems

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