Skip to content

Commit 98c532f

Browse files
committed
Don't escape contents of PCDATA elements. Resolves #127.
1 parent d60e0ec commit 98c532f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mathjax3-ts/adaptors/lite/Parser.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,10 @@ export class LiteParser implements MinDOMParser<LiteDocument> {
339339
* @return{string} The serialized element (like innerHTML)
340340
*/
341341
public serializeInner(adaptor: LiteAdaptor, node: LiteElement) {
342+
const PCDATA = (this.constructor as typeof LiteParser).PCDATA;
343+
if (PCDATA.hasOwnProperty(node.kind)) {
344+
return adaptor.childNodes(node).map(x => adaptor.value(x)).join('');
345+
}
342346
return adaptor.childNodes(node).map(x => {
343347
const kind = adaptor.kind(x);
344348
return (kind === '#text' ? this.protectHTML(adaptor.value(x)) :

0 commit comments

Comments
 (0)