Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Includes with filenames that include "." are not recognized as includes #28

Open
mm-gmbd opened this issue Apr 20, 2022 · 2 comments
Open

Comments

@mm-gmbd
Copy link

mm-gmbd commented Apr 20, 2022

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"
@mm-gmbd
Copy link
Author

mm-gmbd commented Apr 20, 2022

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)"/

@mm-gmbd
Copy link
Author

mm-gmbd commented Apr 20, 2022

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant