Skip to content

Commit

Permalink
fix: comments require multiline regex and end-of-string match
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodedrift committed Aug 22, 2019
1 parent 5a1fa89 commit d521e82
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/Twine2/ChatbookViewer/format.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/npm/common/stripComments.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
exports.default = void 0;
const TOKEN_ESCAPED_OCTO = "__TOKEN_ESCAPED_BACKSLASH_OCTO__";
const BLOCK_COMMENT = /###[\s\S]*?###/gm;
const INLINE_COMMENT = /^#.*$/g;
const INLINE_COMMENT = /^#.*$/gm;

const stripComments = str => str.replace("\\#", TOKEN_ESCAPED_OCTO).replace(BLOCK_COMMENT, "").replace(INLINE_COMMENT, "").replace(TOKEN_ESCAPED_OCTO, "#").trim();

Expand Down
2 changes: 1 addition & 1 deletion src/common/stripComments.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const TOKEN_ESCAPED_OCTO = "__TOKEN_ESCAPED_BACKSLASH_OCTO__";

const BLOCK_COMMENT = /###[\s\S]*?###/gm;
const INLINE_COMMENT = /^#.*$/g;
const INLINE_COMMENT = /^#.*$/gm;

const stripComments = str =>
str
Expand Down

0 comments on commit d521e82

Please sign in to comment.