<commit_before>var textRegExp = /(\\([a-z0-9]+))\s([^\\]*)(\\([a-z0-9]+)\*+)?/g;
// for inline tags

var unparsed = [];

function formatText(text, noteNumber, chapterVerse) {

	textRegExp.lastIndex = 0;
	
	var notes = '';

	
	text = text.replace(textRegExp, function() {
		
		//console.log('handling', arguments);
		
		var key = arguments[2],
			content = arguments[3];
			
		switch(key) {
			case 'f':
			case 'ft':
			case 'fqa':			
				content = content.trim();
				var firstSpace = content.indexOf(' '),
					noteKey = content.substring(0,firstSpace),
					noteText = content.substring(firstSpace+1); 
							
				//return '<span class="note"><span class="key">' + noteKey + '</span><span class="text">' + noteText + '</span></span>';			
				//return '<span class="note" id="note-' + noteKey + '"><a class="key" href="footnote-' + noteKey + '">' + noteKey + '</a><span class="text">' + noteText + '</span></span>';		
				
				notes += 	'<span class="footnote" id="footnote-' + noteNumber + '">' + 
								'<span class="key">' + noteKey + '</span>' +
								'<a class="backref" href="#note-' + noteNumber + '">' + chapterVerse + '</span>' +	
								'<span class="text">' + noteText + '</span>' +
							'</span>'
				noteNumber++;
				
				return '<span class="note" id="note-' + noteNumber + '">' + 
							'<a class="key" href="#footnote-' + noteNumber + '">' + noteKey + '</a>' + <commit_msg>Fixed wrong closing tag<commit_after>var textRegExp = /(\\([a-z0-9]+))\s([^\\]*)(\\([a-z0-9]+)\*+)?/g;
// for inline tags

var unparsed = [];

function formatText(text, noteNumber, chapterVerse) {

	textRegExp.lastIndex = 0;
	
	var notes = '';

	
	text = text.replace(textRegExp, function() {
		
		//console.log('handling', arguments);
		
		var key = arguments[2],
			content = arguments[3];
			
		switch(key) {
			case 'f':
			case 'ft':
			case 'fqa':			
				content = content.trim();
				var firstSpace = content.indexOf(' '),
					noteKey = content.substring(0,firstSpace),
					noteText = content.substring(firstSpace+1); 
							
				//return '<span class="note"><span class="key">' + noteKey + '</span><span class="text">' + noteText + '</span></span>';			
				//return '<span class="note" id="note-' + noteKey + '"><a class="key" href="footnote-' + noteKey + '">' + noteKey + '</a><span class="text">' + noteText + '</span></span>';		
				
				notes += 	'<span class="footnote" id="footnote-' + noteNumber + '">' + 
								'<span class="key">' + noteKey + '</span>' +
								'<a class="backref" href="#note-' + noteNumber + '">' + chapterVerse + '</a>' +	
								'<span class="text">' + noteText + '</span>' +
							'</span>'
				noteNumber++;
				
				return '<span class="note" id="note-' + noteNumber + '">' + 
							'<a class="key" href="#footnote-' + noteNumber + '">' + noteKey + '</a>' + 
{'fraction_non_alphanumeric': 0.23495906016375934, 'fraction_numerical': 0.006407974368102528, 'mean_word_length': 3.025787965616046, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2133315', 'n_tokens_mistral': 1175, 'n_tokens_neox': 948, 'n_words': 197}