Skip to content

Relative paths on image dont work as expected #1

Description

@neerajvash8

I have encountered an issue where my images are listed in top level directly and I am trying to access them in nested directory.

I get error:

INFO    -  MkdocsInlineSelectSvgPlugin: processing img src=../../images/test_working.svg
ERROR   -  Error reading page 'guides/backend_specific_guides/test_example.md': 'MkdocsInlineSelectSvgPlugin' object has no attribute '_MkdocsInlineSelectSvgPlugin__abs_fs_path'
Traceback (most recent call last):
  File "/Users/nv/venv/lib/python3.12/site-packages/mkdocs_inline_select_svg_plugin/plugin.py", line 77, in on_page_content
    svg_content = open(abs_fs_path, 'r').read()
                  ^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/Users/nv/test_repo/docs/guides/images/test_working.svg'

My markdown file is present at /Users/nv/test_repo/docs/guides/backend_specific_guides/test_example.md

My SVG is present at /Users/nv/test_repo/docs/images/test_working.svg

The path the package is trying to resolve is /Users/nv/test_repo/docs/guides/images/test_working.svg is incorrect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions