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

support externally hosted images (v2) #705

Merged
merged 1 commit into from
Feb 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion breathe/renderer/sphinxrenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from sphinx.directives import ObjectDescription
from sphinx.domains import cpp, c, python
from sphinx.util.nodes import nested_parse_with_titles
from sphinx.util import url_re
from sphinx.ext.graphviz import (
graphviz,
html_visit_graphviz,
Expand Down Expand Up @@ -1509,7 +1510,10 @@ def visit_docparblock(self, node) -> List[Node]:
def visit_docimage(self, node) -> List[Node]:
"""Output docutils image node using name attribute from xml as the uri"""

path_to_image = self.project_info.sphinx_abs_path_to_file(node.name)
path_to_image = node.name
if not url_re.match(path_to_image):
path_to_image = self.project_info.sphinx_abs_path_to_file(path_to_image)

options = {"uri": path_to_image}
return [nodes.image("", **options)]

Expand Down