Skip to content

Commit b602619

Browse files
authored
Merge pull request #690 from mathjax/issue2674
Fix problem with not closing empty tags in HTML serialization (mathjax/MathJax#2674)
2 parents 59212ff + fa0265a commit b602619

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ts/adaptors/lite/Parser.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
/*************************************************************
23
*
34
* Copyright (c) 2018 The MathJax Consortium
@@ -358,7 +359,7 @@ export class LiteParser implements MinDOMParser<LiteDocument> {
358359
const content = this.serializeInner(adaptor, node, xml);
359360
const html =
360361
'<' + tag + (attributes ? ' ' + attributes : '')
361-
+ (content && !SELF_CLOSING[tag] ? `>${content}</${tag}>` : xml ? '/>' : '>');
362+
+ ((!xml || content) && !SELF_CLOSING[tag] ? `>${content}</${tag}>` : xml ? '/>' : '>');
362363
return html;
363364
}
364365

0 commit comments

Comments
 (0)