mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
6 lines
207 B
TypeScript
6 lines
207 B
TypeScript
export function parseText(text: string) {
|
|
const entityRegex = /&#(\d+);/g;
|
|
return text.replace(entityRegex, (match, dec) => {
|
|
return String.fromCharCode(dec);
|
|
}).replace(/&/g, '&');
|
|
} |