diff --git a/markdown-include.js b/markdown-include.js index 304cc63..db9a6e8 100644 --- a/markdown-include.js +++ b/markdown-include.js @@ -12,7 +12,7 @@ var q = require('q'); this.ignoreTag = ' !ignore'; this.headingTag = ' !heading'; -this.includePattern = /^#include\s"(.+\/|\/|\w|-|\/)+\.(md|markdown)"/gm; +this.includePattern = /^#include\s"(.+\/|\/|\w|-|\/|\.)+\.(md|markdown)"/gm; this.ignorePattern = new RegExp('^#include\\s"(.+\\/|\\/|\\w|-|\\/)+\.(md|markdown)"' + this.ignoreTag, 'gm'); this.headingPattern = new RegExp('^#+\\s.+' + this.headingTag, 'gm'); this.tableOfContents = ''; diff --git a/tests/data/docs/has_include_tags.md b/tests/data/docs/has_include_tags.md index 3f26199..ba34bd4 100644 --- a/tests/data/docs/has_include_tags.md +++ b/tests/data/docs/has_include_tags.md @@ -1,2 +1,3 @@ #include "tests/data/docs/1.md" -#include "tests/data/docs/2.md" \ No newline at end of file +#include "tests/data/docs/2.md" +#include "tests/data/docs/3.extradot.md" \ No newline at end of file diff --git a/tests/unit/findIncludeTags.js b/tests/unit/findIncludeTags.js index df29983..f1d2090 100644 --- a/tests/unit/findIncludeTags.js +++ b/tests/unit/findIncludeTags.js @@ -8,7 +8,7 @@ define([ bdd.it('should return an array if include tags are found', function () { var file = fs.readFileSync('tests/data/docs/has_include_tags.md').toString(); var findHeadingTags = markdownInclude.findIncludeTags(file); - assert.equal(findHeadingTags.length, 2, 'Heading tags length match'); + assert.equal(findHeadingTags.length, 3, 'Heading tags length match'); }); }); }); \ No newline at end of file