Sha256: ce4eefc04d3715fb90bff9cc17e8976f5273785d483d21567f9e3edceedf8b74

Contents?: true

Size: 1.77 KB

Versions: 80

Compression:

Stored size: 1.77 KB

Contents

// brush: "html" aliases: []

//	This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
//	Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
//	See <jquery.syntax.js> for licensing details.

Syntax.brushes.dependency('html', 'xml');
Syntax.brushes.dependency('html', 'javascript');
Syntax.brushes.dependency('html', 'css');
Syntax.brushes.dependency('html', 'php-script');
Syntax.brushes.dependency('html', 'ruby');

Syntax.register('html', function(brush) {
	brush.push({
		pattern: /<script.*?type\=.?text\/javascript.*?>((.|\n)*?)<\/script>/gmi,
		matches: Syntax.extractMatches({brush: 'javascript'})
	});
	
	brush.push({
		pattern: /<style.*?type=.?text\/css.*?>((.|\n)*?)<\/style>/gmi,
		matches: Syntax.extractMatches({brush: 'css'})
	});
	
	brush.push({
		pattern: /((<\?php)([\s\S]*?)(\?>))/gm,
		matches: Syntax.extractMatches(
			{klass: 'php-tag', allow: ['keyword', 'php-script']},
			{klass: 'keyword'},
			{brush: 'php-script'},
			{klass: 'keyword'}
		)
	});
	
	brush.push({
		pattern: /((<\?rb?)([\s\S]*?)(\?>))/gm,
		matches: Syntax.extractMatches(
			{klass: 'ruby-tag', allow: ['keyword', 'ruby']},
			{klass: 'keyword'},
			{brush: 'ruby'},
			{klass: 'keyword'}
		)
	});
	
	brush.push({
		pattern: /<%=?(.*?)(%>)/g,
		klass: 'instruction',
		allow: ['string']
	});
	
	brush.push({
		pattern: /<\!(DOCTYPE(.*?))>/g,
		matches: Syntax.extractMatches({klass: 'doctype'})
	});
	
	// Is this rule still relevant?
	brush.push({
		pattern: /(%[0-9a-f]{2})/gi,
		klass: 'percent-escape',
		only: ['html']
	});
	
	// The position of this statement is important - it determines at what point the rules of the parent are processed.
	// In this case, the rules for xml are processed after the rules for html.
	brush.derives('xml');
});

Version data entries

80 entries across 49 versions & 2 rubygems

Version Path
utopia-wiki-0.3.0 lib/components/jquery-syntax/source/jquery.syntax.brush.html.js
utopia-wiki-0.2.0 lib/components/jquery-syntax/source/jquery.syntax.brush.html.js
utopia-2.13.4 docs/_components/jquery-syntax/jquery.syntax.brush.html.js
utopia-2.13.4 documentation/public/_components/jquery-syntax/jquery.syntax.brush.html.js
utopia-2.13.3 documentation/public/_components/jquery-syntax/jquery.syntax.brush.html.js
utopia-2.13.3 docs/_components/jquery-syntax/jquery.syntax.brush.html.js
utopia-2.13.2 documentation/public/_components/jquery-syntax/jquery.syntax.brush.html.js
utopia-2.13.2 docs/_components/jquery-syntax/jquery.syntax.brush.html.js
utopia-2.13.1 documentation/public/_components/jquery-syntax/jquery.syntax.brush.html.js
utopia-2.13.1 docs/_components/jquery-syntax/jquery.syntax.brush.html.js
utopia-2.13.0 docs/_components/jquery-syntax/jquery.syntax.brush.html.js
utopia-2.13.0 documentation/public/_components/jquery-syntax/jquery.syntax.brush.html.js
utopia-2.12.4 docs/_components/jquery-syntax/jquery.syntax.brush.html.js
utopia-2.12.4 documentation/public/_components/jquery-syntax/jquery.syntax.brush.html.js
utopia-2.12.3 docs/_components/jquery-syntax/jquery.syntax.brush.html.js
utopia-2.12.3 documentation/public/_components/jquery-syntax/jquery.syntax.brush.html.js
utopia-2.12.2 docs/_components/jquery-syntax/jquery.syntax.brush.html.js
utopia-2.12.2 documentation/public/_components/jquery-syntax/jquery.syntax.brush.html.js
utopia-2.12.1 docs/_components/jquery-syntax/jquery.syntax.brush.html.js
utopia-2.12.1 documentation/public/_components/jquery-syntax/jquery.syntax.brush.html.js