<commit_before>// brush: "xml" aliases: []

//	This file is part of the "jQuery.Syntax" project, and is licensed under the GNU AGPLv3.
//	Copyright 2010 <NAME>. All rights reserved.
//	See <jquery.syntax.js> for licensing details.

Syntax.register('xml', function(brush) {
	brush.push({
		pattern: /(<!(\[CDATA\[)([\s\S]*?)(\]\])>)/gm,
		matches: Syntax.extractMatches(
			{klass: 'cdata', allow: ['cdata-content', 'cdata-tag']},
			{klass: 'cdata-tag'},
			{klass: 'cdata-content'},
			{klass: 'cdata-tag'}
		)
	});
	
	// /[\s\S]/ means match anything... /./ doesn't match newlines
	brush.push({
		pattern: /<[^>]+>/g,
		klass: 'tag',
		allow: '*'
	});
	
	brush.push({
		pattern: /<\/?((?:[\w_\-]+:)?)([\w_\-\.]+)[\s\S]*?>/g,
		matches: Syntax.extractMatches({klass: 'namespace'}, {klass: 'tag-name'})
	});
	
	brush.push({
		pattern: /([\w_\-\.]+)=(".*?"|'.*?'|\S+)/g,
		matches: Syntax.extractMatches({klass: 'attribute', only: ['tag']}, {klass: 'string', only: ['tag']}),
	});
	
	brush.push({
		pattern: /&\w+;/g,
		klass: 'entity'
	});
	
	brush.push({
		pattern: /(%[0-9a-f]{2})/gi,
		klass: 'percent-escape',
		only: ['string']
	});
	
	brush.push(Syntax.lib.xmlComment);
	
	brush.push(Syntax.lib.singleQuotedString);
	brush.push(Syntax.lib.doubleQuotedString);
	
	brush.push(Syntax.lib.webLink);
});

<commit_msg>Better internationalisation support for XML tags and namespaces.<commit_after>// brush: "xml" aliases: []

//	This file is part of the "jQuery.Syntax" project, and is licensed under the GNU AGPLv3.
//	Copyright 2010 <NAME>. All rights reserved.
//	See <jquery.syntax.js> for licensing details.

Syntax.register('xml', function(brush) {
	brush.push({
		pattern: /(<!(\[CDATA\[)([\s\S]*?)(\]\])>)/gm,
		matches: Syntax.extractMatches(
			{klass: 'cdata', allow: ['cdata-content', 'cdata-tag']},
			{klass: 'cdata-tag'},
			{klass: 'cdata-content'},
			{klass: 'cdata-tag'}
		)
	});
	
	brush.push(Syntax.lib.xmlComment);
	
	// /[\s\S]/ means match anything... /./ doesn't match newlines
	brush.push({
		pattern: /<[^>]+>/g,
		klass: 'tag',
		allow: '*'
	});
	
	brush.push({
		pattern: /<\/?((?:\S+?:)?)(\S+)[\s\S]*?>/g,
		matches: Syntax.extractMatches({klass: 'namespace'}, {klass: 'tag-name'})
	});
	
	brush.push({
		pattern: /([\w_\-\.]+)=(".*?"|'.*?'|\S+)/g,
		matches: Syntax.extractMatches({klass: 'attribute', only: ['tag']}, {klass: 'string', only: ['tag']}),
	});
	
	brush.push({
		pattern: /&\w+;/g,
		klass: 'entity'
	});
	
	brush.push({
		pattern: /(%[0-9a-f]{2})/gi,
		klass: 'percent-escape',
		only: ['string']
	});
	
	brush.push(Syntax.lib.singleQuotedString);
	brush.push(Syntax.lib.doubleQuotedString);
	
	brush.push(Syntax.lib.webLink);
});


{'fraction_non_alphanumeric': 0.2615844544095665, 'fraction_numerical': 0.005979073243647235, 'mean_word_length': 3.623488773747841, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2866759', 'n_tokens_mistral': 1156, 'n_tokens_neox': 1044, 'n_words': 201}