diff --git a/packages/utils/src/stringUtils.spec.ts b/packages/utils/src/stringUtils.spec.ts index 4b4918fd60..c1ff61c066 100644 --- a/packages/utils/src/stringUtils.spec.ts +++ b/packages/utils/src/stringUtils.spec.ts @@ -4,6 +4,7 @@ describe('formaterFritekst', () => { it.each([ ['\uFE58', '-'], ['—', '-'], + ['\u00AD', ''], // soft hyphen er en control character ['\t', ' '], ['\u202F', ' '], ['“sitat”', '"sitat"'], diff --git a/packages/utils/src/stringUtils.ts b/packages/utils/src/stringUtils.ts index 27bcecd1ac..f0fd7a4f3c 100644 --- a/packages/utils/src/stringUtils.ts +++ b/packages/utils/src/stringUtils.ts @@ -2,6 +2,7 @@ export const formaterFritekst = (value: string | number) => value.toString() .replace(/\p{Dash_Punctuation}/gu, '-') .replace(/[\p{Space_Separator}\t]/gu, ' ') + .replace(/\u00AD/g, '') .replace(/[“”]/g, '"') .replace(/[‘’`]/g, "'") .replace(/