markdown-include
markdown-include copied to clipboard
Includes with filenames that include "." are not recognized as includes
If a filename includes a "." (separate from the ".md" extension), the file is not found/included and the string is left as-is.
//_readme.md
# A heading
Some text
#include "path/to/working/include.md"
More text
#include "path/to/other/include.5.md"
Resulting markdown:
# A heading
Some text
Some working markdown include
More text
#include "path/to/other/include.5.md"
The current regex is:
/^#include\s"(.+\/|\/|\w|-|\/)+\.(md|markdown)"/
Updating to the following seems to work (adding \. as an optional character match in the middle):
/^#include\s"(.+\/|\/|\w|-|\/|\.)+\.(md|markdown)"/
Related suggestion -- the tool could detect that a line starts with #include but doesn't match the full regex and print an info/warning saying that it detected a potential include but something about the filepath was "funky".