Similar to Org mode's org-open-at-point-functions, this provides a new hook, markdown-follow-link-functions, which may be a list of functions which are called with a link's URL and offered the chance to handle the link-following action.
This allows other libraries to affect how markdown-mode follows links. For example, this allows hyperdrive.el to follow relative links between files in a hyperdrive (i.e. links that are not full URLs but just paths, like ../sibling-directory/file.md).
Among the changes in this PR are an improvement to one of the test macros, and a fix in one of the link-following functions. All the tests still pass as expected.
[x] Bug fix (non-breaking change which fixes an issue)
[x] Improvement (non-breaking change which improves an existing feature)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist
[x] I have read the CONTRIBUTING.md document.
[x] I have updated the documentation in the README.md file if necessary.
[x] I have added an entry to CHANGES.md.
[ ] I have added tests to cover my changes. (It doesn't seem very practical to add automated tests, but the code is very simple, and I have conducted extensive manual testing with hyperdrive-mode.)
[x] All new and existing tests passed (using make test).
Description
Similar to Org mode's
org-open-at-point-functions
, this provides a new hook,markdown-follow-link-functions
, which may be a list of functions which are called with a link's URL and offered the chance to handle the link-following action.This allows other libraries to affect how
markdown-mode
follows links. For example, this allows hyperdrive.el to follow relative links between files in a hyperdrive (i.e. links that are not full URLs but just paths, like../sibling-directory/file.md
).Among the changes in this PR are an improvement to one of the test macros, and a fix in one of the link-following functions. All the tests still pass as expected.
Related Issue
This implements the feature mentioned in https://github.com/jrblevin/markdown-mode/issues/780.
Type of Change
Checklist
hyperdrive-mode
.)make test
).Thanks for your work on
markdown-mode
.