import { browser } from '$app/environment';
import he from 'he';
export function decodeBasicHtmlEntities(text: string): string {
if (!text) return '';
if (browser) {
const doc = new DOMParser().parseFromString(text, 'text/html');
return doc.documentElement.textContent || '';
}
else {
return he.decode(text);
}
}