Skip to content

Commit 475805b

Browse files
committed
issue #9251 HTML extensions stripped from DOT SVG links with tagfiles
In an URL like: `ext_1/external.tag$classext__1_1_1_external_sub_c` the extension is seen like `tag$classext__1_1_1_external_sub_c` as the function searches the entire string for the last `.` instead of looking in the part after the `$`. This is a special case for dot images.
1 parent 5b7315a commit 475805b

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/dotnode.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,15 +471,27 @@ void DotNode::writeBox(TextStream &t,
471471
}
472472
if (!m_url.isEmpty())
473473
{
474-
int anchorPos = m_url.findRev('#');
474+
int tagPos = m_url.findRev('$');
475+
QCString noTagURL;
476+
if (tagPos==-1)
477+
{
478+
t << ",URL=\"";
479+
QCString noTagURL = m_url;
480+
}
481+
else
482+
{
483+
t << ",URL=\"" << m_url.left(tagPos);
484+
noTagURL = m_url.right(m_url.length()-tagPos);
485+
}
486+
int anchorPos = noTagURL.findRev('#');
475487
if (anchorPos==-1)
476488
{
477-
t << ",URL=\"" << addHtmlExtensionIfMissing(m_url) << "\"";
489+
t << addHtmlExtensionIfMissing(noTagURL) << "\"";
478490
}
479491
else
480492
{
481-
t << ",URL=\"" << addHtmlExtensionIfMissing(m_url.left(anchorPos))
482-
<< m_url.right(m_url.length()-anchorPos) << "\"";
493+
t << addHtmlExtensionIfMissing(noTagURL.left(anchorPos))
494+
<< noTagURL.right(noTagURL.length()-anchorPos) << "\"";
483495
}
484496
}
485497
}

0 commit comments

Comments
 (0)