<commit_before>$.Redactor.prototype.WoltLabClean = function() {
	"use strict";
	
	return {
		init: function () {
			this.opts.pasteInlineTags = this.opts.pasteInlineTags.filter(function (value) {
				return (value !== 'span');
			});
			
			var mpOnSet = this.clean.onSet;
			this.clean.onSet = (function (html) {
				return mpOnSet.call(this, html.replace(/\u200B/g, ''));
			}).bind(this);
			
			var mpOnSync = this.clean.onSync;
			this.clean.onSync = (function (html) {
				var div = elCreate('div');
				var replacements = {};
				
				if (html.indexOf('<pre') !== -1) {
					div.innerHTML = html;
					
					elBySelAll('pre', div, function (pre) {
						var uuid = WCF.getUUID();
						
						replacements[uuid] = pre.textContent;
						pre.textContent = uuid;
					});
					
					html = div.innerHTML;
				}
				
				html = html.replace(/<p>\u200B<\/p>/g, '<p><br></p>');
				
				html = mpOnSync.call(this, html);
				
				div.innerHTML = html;
				
				elBySelAll('span', div, function (span) {
					span.outerHTML = span.innerHTML;
				});
				elBySelAll('pre', div, function (pre) {
					if (replacements.hasOwnProperty(pre.textContent)) {
						pre.textContent = replacements[pre.textContent];
					}
				});
				
				html = div.innerHTML;
				
				return html;
			}).bind(this);
			
			var mpSavePreFormatting = this.clean.savePreFormatting;
			this.clean.savePreFormatting = (function (html) {
				var mpCleanEncodeEntities = this.clean.encodeEntities;
				this.clean.encodeEntities = function(str) {
					return WCF.String.escapeHTML(str);<commit_msg>Fixed encoded ampersands being replaced<commit_after>$.Redactor.prototype.WoltLabClean = function() {
	"use strict";
	
	return {
		init: function () {
			this.opts.pasteInlineTags = this.opts.pasteInlineTags.filter(function (value) {
				return (value !== 'span');
			});
			
			var mpOnSet = this.clean.onSet;
			this.clean.onSet = (function (html) {
				html = html.replace(/\u200B/g, '');
				
				// fix ampersands being replaced
				html = html.replace(/&amp;/g, '@@@WCF_AMPERSAND@@@');
				
				html = mpOnSet.call(this, html);
				
				// restore ampersands
				html = html.replace(/@@@WCF_AMPERSAND@@@/g, '&amp;');
				
				return html;
			}).bind(this);
			
			var mpOnSync = this.clean.onSync;
			this.clean.onSync = (function (html) {
				var div = elCreate('div');
				var replacements = {};
				
				// fix ampersands being replaced
				html = html.replace(/&amp;/g, '@@@WCF_AMPERSAND@@@');
				
				if (html.indexOf('<pre') !== -1) {
					div.innerHTML = html;
					
					elBySelAll('pre', div, function (pre) {
						var uuid = WCF.getUUID();
						
						replacements[uuid] = pre.textContent;
						pre.textContent = uuid;
					});
					
					html = div.innerHTML;
				}
				
				html = html.replace(/<p>\u200B<\/p>/g, '<p><br></p>');
				
				html = mpOnSync.call(this, html);
				
				// restore ampersands
				html = html.replace(/@@@WCF_AMPERSAND@@@/g, '&amp;');
				
				div.innerHTML = html;
				
				elBySelAll('span', div, function (span) {
					span.outerHTML = span.innerHTML;
				});
				elBySelAll('pre', div, function (pre) {
					if (replacements.hasOwnProperty(pre.textContent)) {
						pre.textContent = replacements[pre.textContent];
					}
				});
				
				html = div.innerHTML;
				
				return html;
			}).bind(this);
			
			var mpSavePreFormatting = this.clean.savePreFormatting;
			this.clean.savePreFormatting = (function (html) {
				var mpCleanEncodeEntities = this.clean.encodeEntities;
				this.clean.encodeEntities = function(str) {
					return WCF.String.escapeHTML(str);
{'fraction_non_alphanumeric': 0.16024567280848687, 'fraction_numerical': 0.003908431044109436, 'mean_word_length': 2.622851365015167, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, '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': '3523663', 'n_tokens_mistral': 1619, 'n_tokens_neox': 1198, 'n_words': 215}