jats-xml
Version:
Types and utilities for working with JATS in Typescript
14 lines • 555 B
TypeScript
export type SanitizeXmlEntitiesResult = {
xml: string;
/** How many bare `&` were rewritten to `&`. */
escapedBareAmpersandCount: number;
};
/**
* Escape bare ampersands so xml-js (and other XML parsers) do not fail with
* "Invalid character in entity name" / unterminated reference errors.
*
* Existing `&`, `–`, `{`, etc. are left unchanged; xml-js expands
* those when parsing.
*/
export declare function sanitizeXmlEntities(xml: string): SanitizeXmlEntitiesResult;
//# sourceMappingURL=sanitizeXmlEntities.d.ts.map