From 52efbbcfcd11fdee1a33994f014777f47ea6a43a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 22 Feb 2019 19:00:44 +0100 Subject: [PATCH] doxygen: support image links. Yay? Nah. It's still crappy, you still can't have \image inside \ref. --- doxygen/dox2html5.py | 2 +- doxygen/test/contents_image/imagelink.html | 31 ++++++++++++++++++++++ doxygen/test/contents_image/input.dox | 8 ++++++ doxygen/test/test_contents.py | 6 +++++ 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 doxygen/test/contents_image/imagelink.html diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index ba43f27a..01b90fb9 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -1200,7 +1200,7 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET. out.parsed += '
{}
'.format(html.escape(i.text or '')) elif i.tag == 'image': - assert element.tag in ['para', '{http://mcss.mosra.cz/doxygen/}div'] + assert element.tag in ['para', '{http://mcss.mosra.cz/doxygen/}div', 'ulink'] has_block_elements = True name = i.attrib['name'] diff --git a/doxygen/test/contents_image/imagelink.html b/doxygen/test/contents_image/imagelink.html new file mode 100644 index 00000000..d8e5ff29 --- /dev/null +++ b/doxygen/test/contents_image/imagelink.html @@ -0,0 +1,31 @@ + + + + + Image link | My Project + + + + + +
+
+
+
+
+

+ Image link +

+

Broken in 1.8.15 and below.

Image

+
+
+
+
+ + diff --git a/doxygen/test/contents_image/input.dox b/doxygen/test/contents_image/input.dox index 736ce2a8..3ab8fd96 100644 --- a/doxygen/test/contents_image/input.dox +++ b/doxygen/test/contents_image/input.dox @@ -25,3 +25,11 @@ Image that doesn't exist: @image html nonexistent.png */ + +/** @page imagelink Image link + +Broken in 1.8.15 and below. + + + +*/ diff --git a/doxygen/test/test_contents.py b/doxygen/test/test_contents.py index 607818d9..f3928360 100644 --- a/doxygen/test/test_contents.py +++ b/doxygen/test/test_contents.py @@ -117,6 +117,12 @@ class Image(IntegrationTestCase): self.run_dox2html5(wildcard='warnings.xml') self.assertEqual(*self.actual_expected_contents('warnings.html')) + @unittest.skipUnless(LooseVersion(doxygen_version()) > LooseVersion("1.8.15"), + "fully fixed after 1:8.15") + def test_imagelink(self): + self.run_dox2html5(wildcard='imagelink.xml') + self.assertEqual(*self.actual_expected_contents('imagelink.html')) + class Math(IntegrationTestCase): def __init__(self, *args, **kwargs): super().__init__(__file__, 'math', *args, **kwargs) -- 2.30.2