bugfixing: make it safari 15.6 compatible
This commit is contained in:
parent
d5c6d10a1a
commit
341d6c0120
@ -11,10 +11,29 @@ let showFullText = false;
|
|||||||
// Function to split text into paragraphs
|
// Function to split text into paragraphs
|
||||||
|
|
||||||
function splitIntoParagraphs(text) {
|
function splitIntoParagraphs(text) {
|
||||||
// Split the text into paragraphs based on periods followed by spaces, excluding numbers with decimals
|
if (!text) return [];
|
||||||
return text?.replace('U.S.', 'US')?.split(/(?<!\d\.\d)(?<!vs)\.\s/);
|
|
||||||
|
// Replace "U.S." and "vs." with placeholders
|
||||||
|
const placeholderUS = '__US__';
|
||||||
|
const placeholderVs = '__VS__';
|
||||||
|
|
||||||
|
let tempText = text.replace(/U\.S\./g, placeholderUS)
|
||||||
|
.replace(/vs\./g, placeholderVs);
|
||||||
|
|
||||||
|
// Split the text based on periods followed by spaces
|
||||||
|
let paragraphs = tempText.split(/\. \s*/);
|
||||||
|
|
||||||
|
// Restore the placeholders back to "U.S." and "vs."
|
||||||
|
paragraphs = paragraphs.map(paragraph =>
|
||||||
|
paragraph.replace(new RegExp(placeholderUS, 'g'), 'U.S.')
|
||||||
|
.replace(new RegExp(placeholderVs, 'g'), 'vs.')
|
||||||
|
);
|
||||||
|
|
||||||
|
return paragraphs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let paragraphs = splitIntoParagraphs(rawData?.bullSays);
|
let paragraphs = splitIntoParagraphs(rawData?.bullSays);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -180,6 +180,7 @@ let Cookie;
|
|||||||
$showCookieConsent = typeof data?.cookieConsent !== 'undefined' ? false : true;
|
$showCookieConsent = typeof data?.cookieConsent !== 'undefined' ? false : true;
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
|
//await fallbackWorker();
|
||||||
await loadWorker();
|
await loadWorker();
|
||||||
//await pushNotification()
|
//await pushNotification()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user