Skip to content

Rewriting paths #13

@BrekiTomasson

Description

@BrekiTomasson

Assuming you're in /opt/doc/file.md and you include ./included/first.md, but that file has an inline image referencing ./img/logo.gif, the resulting Markdown would be looking for /opt/doc/img/logo.gif, while the image is actually at /opt/doc/included/img/logo.gif.

Would it be possible (via a config flag or similar) to get the plugin to scan included files and rewrite any paths discovered accordingly? Something like path.resolve(basePath, path.resolve(path.dirname(path.join(basePath, importPath)) should do the trick, assuming basePath is the path of the parent file and importPath is the path of the imported file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions