Skip to content

Commit

Permalink
Allow handling of self-closing tags. Resolves issue #328
Browse files Browse the repository at this point in the history
  • Loading branch information
dpvc committed Oct 20, 2019
1 parent ca79c70 commit 3a3085f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ts/adaptors/lite/Parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export class LiteParser implements MinDOMParser<LiteDocument> {
//
// Get the child to be added to the node
//
const kind = tag.match(/<(.*?)[\s\n>]/)[1].toLowerCase();
const kind = tag.match(/<(.*?)[\s\n>/]/)[1].toLowerCase();
const child = adaptor.node(kind) as LiteElement;
//
// Split out the tag attributes as an array of space, name, value1, value3, value3,
Expand All @@ -211,7 +211,7 @@ export class LiteParser implements MinDOMParser<LiteDocument> {
// Otherwise, the child tag becames the parent node to which
// new tags are added
//
if (!SELF_CLOSING[kind]) {
if (!SELF_CLOSING[kind] && !tag.match(/\/>$/)) {
if (PCDATA[kind]) {
this.handlePCDATA(adaptor, child, kind, parts);
} else {
Expand Down

0 comments on commit 3a3085f

Please sign in to comment.