Merge pull request #8334 from Repiteo/space-to-tab-v3

Reimplement space-to-tab regex without lookbehind
This commit is contained in:
Max Hilbrunner
2023-11-11 05:06:01 +01:00
committed by Max Hilbrunner
parent 0d933eaa77
commit 5aaa6648f0
+6 -2
View File
@@ -299,8 +299,12 @@ $(document).ready(() => {
// Only change indentation for GDScript and C++.
continue;
}
let html = codeBlock.innerHTML;
html = html.replace(/(?<=^(<span class="w">)?( {4})*)( {4})/gm, '\t');
let html = codeBlock.innerHTML.replace(/^(<span class="w">)?( {4})/gm, '\t');
let html_old = "";
while (html != html_old) {
html_old = html;
html = html.replace(/\t( {4})/gm, '\t\t')
}
codeBlock.innerHTML = html;
}