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

Fix absolute path includes from a subdir #452

Merged
merged 4 commits into from
Aug 1, 2023

Conversation

dometto
Copy link
Member

@dometto dometto commented Aug 1, 2023

Resolves gollum/gollum#1978

As gollum/gollum#1978 explains, include tags with an absolute path currently do not work. The file-to-include is always resolved as the current directory plus the path provided in the tag. This does not work when attempting to include an absolute path in a document in a subidr (the resolved file will then be "/subdir/absolute/path" instead of "/absolute/path").

This PR addresses the issue by checking the include path in order to determine whether it is absolute or not, and only prepending the current directory path in case it is relative.

Many thanks to @aaakbar for identifying the issue and pinpointing the solution!

Copy link
Member

@bartkamphorst bartkamphorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dometto dometto merged commit dbca58f into gollum:master Aug 1, 2023
4 checks passed
@dometto dometto deleted the fix_gollum1978 branch August 1, 2023 19:31
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

Successfully merging this pull request may close these issues.

Include tag not working with absolute paths
2 participants