facet fix?
This commit is contained in:
parent
96a0414638
commit
7476ffb4c1
1 changed files with 9 additions and 4 deletions
|
@ -358,6 +358,7 @@ export function ApplyFacets(record, text) {
|
|||
}
|
||||
// Last minute append.
|
||||
SplitAreas.push(text.length);
|
||||
|
||||
let SubtractNumber = 0;
|
||||
// Now we split the string
|
||||
for (let i = 1; i < SplitAreas.length; i++) {
|
||||
|
@ -366,11 +367,15 @@ export function ApplyFacets(record, text) {
|
|||
let EmojiObjects = TextThing.match(/\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F/gu);
|
||||
if (EmojiObjects != null) {
|
||||
SubtractNumber = SubtractNumber + (EmojiObjects.length * 2);
|
||||
StringArray.push(text.slice(SplitAreas[i - 1] - SubtractNumber, SplitAreas[i] - SubtractNumber));
|
||||
} else {
|
||||
// If no regex, just send it.
|
||||
StringArray.push(TextThing);
|
||||
if (SplitAreas[i - 1] == 0) {
|
||||
TextThing = text.slice(SplitAreas[i - 1], SplitAreas[i] - SubtractNumber);
|
||||
} else if (SplitAreas[i] == text.length) {
|
||||
TextThing = text.slice(SplitAreas[i - 1] - SubtractNumber, SplitAreas[i]);
|
||||
} else {
|
||||
TextThing = text.slice(SplitAreas[i - 1] - SubtractNumber, SplitAreas[i] - SubtractNumber);
|
||||
}
|
||||
}
|
||||
StringArray.push(TextThing);
|
||||
}
|
||||
// Finally, we append the string with <a>
|
||||
for (let i = 0; i < StringArray.length; i += 2) {
|
||||
|
|
Loading…
Add table
Reference in a new issue