Highlight the differences of the updated bio text in Feed 1

This commit is contained in:
Natsumi
2024-11-12 11:33:21 +13:00
parent c052a28aa6
commit 435a2e3d3d
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -5767,7 +5767,7 @@ speechSynthesis.getVoices();
}; };
}; };
$app.methods.findSequeces = function (arr) { $app.methods.findSequences = function (arr) {
if (arr.length === 0) return []; if (arr.length === 0) return [];
return arr.reduce( return arr.reduce(
(p, c, i) => { (p, c, i) => {
@@ -5792,7 +5792,7 @@ speechSynthesis.getVoices();
* @param {*} s2 * @param {*} s2
* @param {*} markerStartTag * @param {*} markerStartTag
* @param {*} markerEndTag * @param {*} markerEndTag
* @returns An array that contains both the string 1 and string 2, which the differences are formated with HTML tags * @returns An array that contains both the string 1 and string 2, which the differences are formatted with HTML tags
*/ */
$app.methods.formatDifference = function ( $app.methods.formatDifference = function (
s1, s1,
@@ -5803,7 +5803,7 @@ speechSynthesis.getVoices();
const texts = [s1, s2]; const texts = [s1, s2];
const differs = $app.findDifferences(s1, s2); const differs = $app.findDifferences(s1, s2);
return Object.values(differs) return Object.values(differs)
.map((i) => $app.findSequeces(i.map((j) => j.index))) .map((i) => $app.findSequences(i.map((j) => j.index)))
.map((i, k) => { .map((i, k) => {
let stringBuilder = []; let stringBuilder = [];
let lastPos = 0; let lastPos = 0;