const W_NS = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main';
const R_NS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships';
const CONTENT_TYPES = `
`;
const ROOT_RELS = `
`;
const DOCUMENT_RELS = `
`;
function escapeXml(value) {
return String(value ?? '')
.replace(/&/g, '&')
.replace(//g, '>')
.replace(/"/g, '"');
}
function decodeHtmlEntities(value) {
return String(value ?? '')
.replace(/ /gi, ' ')
.replace(/&/gi, '&')
.replace(/</gi, '<')
.replace(/>/gi, '>')
.replace(/"/gi, '"')
.replace(/'/gi, "'")
.replace(/(\d+);/g, (_, code) => String.fromCodePoint(Number(code)))
.replace(/([0-9a-f]+);/gi, (_, code) => String.fromCodePoint(Number.parseInt(code, 16)));
}
export function extractPlainTextFromHtml(html) {
return decodeHtmlEntities(
String(html ?? '')
.replace(/