Skip to content

Commit 2d3ee3d

Browse files
committed
Area tag does not give alt="" as of dot 7.0.2
Graphviz dot does not write out `alt=""` with the `area` tag as of version 7.0.2, the attribute should be IMPLIED / optional. From https://gitlab.com/graphviz/graphviz/-/issues/265 and https://gitlab.com/graphviz/graphviz/-/issues/2319 On the page https://www.w3schools.com/tags/tag_area.asp I see under Attributes: > | alt | text | Specifies an alternate text for the area. Required if the href attribute is present | Also in the file https://www.w3.org/TR/2018/SPSD-xhtml1-20180327/DTD/xhtml1-strict.dtd I see: ``` <!ELEMENT area EMPTY> <!ATTLIST area %attrs; %focus; shape %Shape; "rect" coords %Coords; #IMPLIED href %URI; #IMPLIED nohref (nohref) #IMPLIED alt %Text; #REQUIRED > ``` and in https://www.w3.org/TR/2018/SPSD-xhtml1-20180327/DTD/xhtml1-transitional.dtd I see: ``` <!ELEMENT area EMPTY> <!ATTLIST area %attrs; %focus; shape %Shape; "rect" coords %Coords; #IMPLIED href %URI; #IMPLIED nohref (nohref) #IMPLIED alt %Text; #REQUIRED target %FrameTarget; #IMPLIED > ```
1 parent bb57609 commit 2d3ee3d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/dotfilepatcher.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,14 @@ bool DotFilePatcher::convertMapFile(TextStream &t,const QCString &mapName,
233233
if (buf.startsWith("<area"))
234234
{
235235
QCString replBuf = replaceRef(buf,relPath,urlOnly,context);
236+
// in dot version 7.0.2 the alt attribute is, incorrectly, removed.
237+
// see https://gitlab.com/graphviz/graphviz/-/issues/265
238+
int indexA = replBuf.find("alt=");
239+
if (indexA == -1)
240+
{
241+
replBuf = replBuf.left(5) + " alt=\"\"" + replBuf.right(replBuf.length() - 5);
242+
}
243+
236244
// strip id="..." from replBuf since the id's are not needed and not unique.
237245
int indexS = replBuf.find("id=\""), indexE;
238246
if (indexS>0 && (indexE=replBuf.find('"',indexS+4))!=-1)

0 commit comments

Comments
 (0)