Skip to content

Commit

Permalink
Fixed bug in handling of atomic tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
mn4367 committed Apr 13, 2018
1 parent 5403c4e commit 753af72
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion htmldiff-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let atomicTags: string | null = null;
*/
function printUsage(): void {
const usage: string =
`${cli} v0.9.0
`${cli} v0.9.3
Usage: ${cli} beforeFile afterFile diffedFile [Options]
Expand Down
4 changes: 2 additions & 2 deletions js/htmldiff.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
*/
var atomicTagsRegExp;
// Added head and style (for style tags inside the body)
var defaultAtomicTagsRegExp = new RegExp('^<(iframe,object,math,svg,script,video,head,style)');
var defaultAtomicTagsRegExp = new RegExp('^<(iframe|object|math|svg|script|video|head|style)');

/**
* Checks if the current word is the beginning of an atomic tag. An atomic tag is one whose
Expand Down Expand Up @@ -954,7 +954,7 @@

// Enable user provided atomic tag list.
atomicTags ?
(atomicTagsRegExp = new RegExp('^<(' + atomicTags.replace(/\s*/g, "").trim() + ')'))
(atomicTagsRegExp = new RegExp('^<(' + atomicTags.replace(/\s*/g, '').replace(/,/g, '|') + ')'))
: (atomicTagsRegExp = defaultAtomicTagsRegExp);

before = htmlToTokens(before);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Diff and markup HTML with <ins> and <del> tags",
"companyname": "idesis GmbH",
"copyright": "©2018, idesis GmbH; ©2012 The Network Inc. and contributors",
"version": "0.9.2",
"version": "0.9.3",
"identifier": "de.idesis.node-htmldiff",
"keywords": [
"diff",
Expand Down

0 comments on commit 753af72

Please sign in to comment.