Doxygen
Loading...
Searching...
No Matches
htmldocvisitor.cpp File Reference
#include "htmldocvisitor.h"
#include "docparser.h"
#include "language.h"
#include "doxygen.h"
#include "outputgen.h"
#include "outputlist.h"
#include "dot.h"
#include "message.h"
#include "config.h"
#include "htmlgen.h"
#include "parserintf.h"
#include "msc.h"
#include "dia.h"
#include "util.h"
#include "vhdldocgen.h"
#include "filedef.h"
#include "memberdef.h"
#include "htmlentity.h"
#include "emoji.h"
#include "plantuml.h"
#include "formula.h"
#include "fileinfo.h"
#include "indexlist.h"
#include "growbuf.h"
#include "portable.h"
#include "codefragment.h"
Include dependency graph for htmldocvisitor.cpp:

Go to the source code of this file.

Enumerations

enum class  contexts_t {
  NONE , STARTLI , STARTDD , ENDLI ,
  ENDDD , STARTTD , ENDTD , INTERLI ,
  INTERDD , INTERTD
}

Functions

static constexpr const char * contexts (contexts_t type)
static QCString convertIndexWordToAnchor (const QCString &word)
static bool mustBeOutsideParagraph (const DocNodeVariant &n)
static bool isDocVerbatimVisible (const DocVerbatim &s)
static bool isDocIncludeVisible (const DocInclude &s)
static bool isDocIncOperatorVisible (const DocIncOperator &s)
static bool isInvisibleNode (const DocNodeVariant &node)
static QCString makeShortName (const QCString &name)
static QCString makeBaseName (const QCString &name)
template<class Node>
static bool holds_value (const Node *val, const DocNodeVariant &v)
template<class T>
bool isFirstChildNode (const T *parent, const DocPara &node)
template<class T>
bool isLastChildNode (const T *parent, const DocPara &node)
bool isSeparatedParagraph (const DocSimpleSect &parent, const DocPara &par)
static contexts_t getParagraphContext (const DocPara &p, bool &isFirst, bool &isLast)
static bool determineIfNeedsTag (const DocPara &p)
static bool insideStyleChangeThatIsOutsideParagraph (const DocPara *para, DocNodeList::const_iterator it)
 Returns TRUE if the child nodes in paragraph para until nodeIndex contain a style change node that is still active and that style change is one that must be located outside of a paragraph, i.e.

Variables

static const int NUM_HTML_LIST_TYPES = 4
static const char g_types [][NUM_HTML_LIST_TYPES] = {"1", "a", "i", "A"}
static const char * hex ="0123456789ABCDEF"

Enumeration Type Documentation

◆ contexts_t

enum class contexts_t
strong
Enumerator
NONE 
STARTLI 
STARTDD 
ENDLI 
ENDDD 
STARTTD 
ENDTD 
INTERLI 
INTERDD 
INTERTD 

Definition at line 45 of file htmldocvisitor.cpp.

46{
47 NONE, // 0
48 STARTLI, // 1
49 STARTDD, // 2
50 ENDLI, // 3
51 ENDDD, // 4
52 STARTTD, // 5
53 ENDTD, // 6
54 INTERLI, // 7
55 INTERDD, // 8
56 INTERTD // 9
57};

Function Documentation

◆ contexts()

constexpr const char * contexts ( contexts_t type)
staticconstexpr

Definition at line 59 of file htmldocvisitor.cpp.

60{
61 switch (type)
62 {
63 case contexts_t::NONE: return nullptr;
64 case contexts_t::STARTLI: return "startli";
65 case contexts_t::STARTDD: return "startdd";
66 case contexts_t::ENDLI: return "endli";
67 case contexts_t::ENDDD: return "enddd";
68 case contexts_t::STARTTD: return "starttd";
69 case contexts_t::ENDTD: return "endtd";
70 case contexts_t::INTERLI: return "interli";
71 case contexts_t::INTERDD: return "interdd";
72 case contexts_t::INTERTD: return "intertd";
73 default: return nullptr;
74 }
75}

References ENDDD, ENDLI, ENDTD, INTERDD, INTERLI, INTERTD, NONE, STARTDD, STARTLI, and STARTTD.

Referenced by HtmlDocVisitor::operator()().

◆ convertIndexWordToAnchor()

QCString convertIndexWordToAnchor ( const QCString & word)
static

Definition at line 78 of file htmldocvisitor.cpp.

79{
80 static int cnt = 0;
81 QCString result="a";
82 QCString cntStr;
83 result += cntStr.setNum(cnt);
84 result += "_";
85 cnt++;
86 const char *str = word.data();
87 unsigned char c = 0;
88 if (str)
89 {
90 while ((c = *str++))
91 {
92 if ((c >= 'a' && c <= 'z') || // ALPHA
93 (c >= 'A' && c <= 'Z') || // ALPHA
94 (c >= '0' && c <= '9') || // DIGIT
95 c == '-' ||
96 c == '.'
97 )
98 {
99 result += c;
100 }
101 else
102 {
103 char enc[4];
104 enc[0] = '_';
105 enc[1] = hex[(c & 0xf0) >> 4];
106 enc[2] = hex[c & 0xf];
107 enc[3] = 0;
108 result += enc;
109 }
110 }
111 }
112 return result;
113}
This is an alternative implementation of QCString.
Definition qcstring.h:101
QCString & setNum(short n)
Definition qcstring.h:444
static constexpr auto hex
std::string_view word
Definition util.cpp:980

References hex, QCString::setNum(), and word.

Referenced by HtmlDocVisitor::operator()().

◆ determineIfNeedsTag()

bool determineIfNeedsTag ( const DocPara & p)
static

Definition at line 1263 of file htmldocvisitor.cpp.

1264{
1265 bool needsTag = FALSE;
1266 if (p.parent())
1267 {
1281 >(*p.parent()))
1282 {
1283 needsTag = TRUE;
1284 }
1285 else if (std::get_if<DocRoot>(p.parent()))
1286 {
1287 needsTag = !std::get<DocRoot>(*p.parent()).singleLine();
1288 }
1289 }
1290 return needsTag;
1291}
Node representing an item of a auto list.
Definition docnode.h:591
Node representing an HTML blockquote.
Definition docnode.h:1286
Node representing a HTML table cell.
Definition docnode.h:1188
Node representing a HTML description data.
Definition docnode.h:1176
Node Html details.
Definition docnode.h:852
Node representing a HTML list item.
Definition docnode.h:1160
Node Html summary.
Definition docnode.h:839
Node representing an internal section of documentation.
Definition docnode.h:964
DocNodeVariant * parent()
Definition docnode.h:89
Node representing an block of paragraphs.
Definition docnode.h:974
Node representing a normal section.
Definition docnode.h:909
Node representing a simple list item.
Definition docnode.h:1148
Node representing a simple section.
Definition docnode.h:1012
Node representing an item of a cross-referenced list.
Definition docnode.h:616
constexpr bool holds_one_of_alternatives(const DocNodeVariant &v)
returns true iff v holds one of types passed as template parameters
Definition docnode.h:1361
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34

References FALSE, holds_one_of_alternatives(), DocNode::parent(), and TRUE.

Referenced by HtmlDocVisitor::operator()().

◆ getParagraphContext()

contexts_t getParagraphContext ( const DocPara & p,
bool & isFirst,
bool & isLast )
static

Definition at line 1131 of file htmldocvisitor.cpp.

1132{
1134 isFirst=FALSE;
1135 isLast=FALSE;
1136 if (p.parent())
1137 {
1138 const auto parBlock = std::get_if<DocParBlock>(p.parent());
1139 if (parBlock)
1140 {
1141 // hierarchy: node N -> para -> parblock -> para
1142 // adapt return value to kind of N
1143 const DocNodeVariant *p3 = nullptr;
1144 if (::parent(p.parent()) && ::parent(::parent(p.parent())) )
1145 {
1146 p3 = ::parent(::parent(p.parent()));
1147 }
1148 isFirst=isFirstChildNode(parBlock,p);
1149 isLast =isLastChildNode (parBlock,p);
1150 bool isLI = p3!=nullptr && holds_one_of_alternatives<DocHtmlListItem,DocSecRefItem>(*p3);
1152 bool isTD = p3!=nullptr && holds_one_of_alternatives<DocHtmlCell,DocParamList>(*p3);
1154 if (isFirst)
1155 {
1156 if (isLI) t=contexts_t::STARTLI; else if (isDD) t=contexts_t::STARTDD; else if (isTD) t=contexts_t::STARTTD;
1157 }
1158 if (isLast)
1159 {
1160 if (isLI) t=contexts_t::ENDLI; else if (isDD) t=contexts_t::ENDDD; else if (isTD) t=contexts_t::ENDTD;
1161 }
1162 if (!isFirst && !isLast)
1163 {
1164 if (isLI) t=contexts_t::INTERLI; else if (isDD) t=contexts_t::INTERDD; else if (isTD) t=contexts_t::INTERTD;
1165 }
1166 return t;
1167 }
1168 const auto docAutoListItem = std::get_if<DocAutoListItem>(p.parent());
1169 if (docAutoListItem)
1170 {
1171 isFirst=isFirstChildNode(docAutoListItem,p);
1172 isLast =isLastChildNode (docAutoListItem,p);
1173 t=contexts_t::STARTLI; // not used
1174 return t;
1175 }
1176 const auto docSimpleListItem = std::get_if<DocSimpleListItem>(p.parent());
1177 if (docSimpleListItem)
1178 {
1179 isFirst=TRUE;
1180 isLast =TRUE;
1181 t=contexts_t::STARTLI; // not used
1182 return t;
1183 }
1184 const auto docParamList = std::get_if<DocParamList>(p.parent());
1185 if (docParamList)
1186 {
1187 isFirst=TRUE;
1188 isLast =TRUE;
1189 t=contexts_t::STARTLI; // not used
1190 return t;
1191 }
1192 const auto docHtmlListItem = std::get_if<DocHtmlListItem>(p.parent());
1193 if (docHtmlListItem)
1194 {
1195 isFirst=isFirstChildNode(docHtmlListItem,p);
1196 isLast =isLastChildNode (docHtmlListItem,p);
1197 if (isFirst) t=contexts_t::STARTLI;
1198 if (isLast) t=contexts_t::ENDLI;
1199 if (!isFirst && !isLast) t = contexts_t::INTERLI;
1200 return t;
1201 }
1202 const auto docSecRefItem = std::get_if<DocSecRefItem>(p.parent());
1203 if (docSecRefItem)
1204 {
1205 isFirst=isFirstChildNode(docSecRefItem,p);
1206 isLast =isLastChildNode (docSecRefItem,p);
1207 if (isFirst) t=contexts_t::STARTLI;
1208 if (isLast) t=contexts_t::ENDLI;
1209 if (!isFirst && !isLast) t = contexts_t::INTERLI;
1210 return t;
1211 }
1212 const auto docHtmlDescData = std::get_if<DocHtmlDescData>(p.parent());
1213 if (docHtmlDescData)
1214 {
1215 isFirst=isFirstChildNode(docHtmlDescData,p);
1216 isLast =isLastChildNode (docHtmlDescData,p);
1217 if (isFirst) t=contexts_t::STARTDD;
1218 if (isLast) t=contexts_t::ENDDD;
1219 if (!isFirst && !isLast) t = contexts_t::INTERDD;
1220 return t;
1221 }
1222 const auto docXRefItem = std::get_if<DocXRefItem>(p.parent());
1223 if (docXRefItem)
1224 {
1225 isFirst=isFirstChildNode(docXRefItem,p);
1226 isLast =isLastChildNode (docXRefItem,p);
1227 if (isFirst) t=contexts_t::STARTDD;
1228 if (isLast) t=contexts_t::ENDDD;
1229 if (!isFirst && !isLast) t = contexts_t::INTERDD;
1230 return t;
1231 }
1232 const auto docSimpleSect = std::get_if<DocSimpleSect>(p.parent());
1233 if (docSimpleSect)
1234 {
1235 isFirst=isFirstChildNode(docSimpleSect,p);
1236 isLast =isLastChildNode (docSimpleSect,p);
1237 if (isFirst) t=contexts_t::STARTDD;
1238 if (isLast) t=contexts_t::ENDDD;
1239 if (isSeparatedParagraph(*docSimpleSect,p))
1240 // if the paragraph is enclosed with separators it will
1241 // be included in <dd>..</dd> so avoid addition paragraph
1242 // markers
1243 {
1244 isFirst=isLast=TRUE;
1245 }
1246 if (!isFirst && !isLast) t = contexts_t::INTERDD;
1247 return t;
1248 }
1249 const auto docHtmlCell = std::get_if<DocHtmlCell>(p.parent());
1250 if (docHtmlCell)
1251 {
1252 isFirst=isFirstChildNode(docHtmlCell,p);
1253 isLast =isLastChildNode (docHtmlCell,p);
1254 if (isFirst) t=contexts_t::STARTTD;
1255 if (isLast) t=contexts_t::ENDTD;
1256 if (!isFirst && !isLast) t = contexts_t::INTERTD;
1257 return t;
1258 }
1259 }
1260 return t;
1261}
std::variant< DocWord, DocLinkedWord, DocURL, DocLineBreak, DocHorRuler, DocAnchor, DocCite, DocStyleChange, DocSymbol, DocEmoji, DocWhiteSpace, DocSeparator, DocVerbatim, DocInclude, DocIncOperator, DocFormula, DocIndexEntry, DocAutoList, DocAutoListItem, DocTitle, DocXRefItem, DocImage, DocDotFile, DocMscFile, DocDiaFile, DocVhdlFlow, DocLink, DocRef, DocInternalRef, DocHRef, DocHtmlHeader, DocHtmlDescTitle, DocHtmlDescList, DocSection, DocSecRefItem, DocSecRefList, DocInternal, DocParBlock, DocSimpleList, DocHtmlList, DocSimpleSect, DocSimpleSectSep, DocParamSect, DocPara, DocParamList, DocSimpleListItem, DocHtmlListItem, DocHtmlDescData, DocHtmlCell, DocHtmlCaption, DocHtmlRow, DocHtmlTable, DocHtmlBlockQuote, DocText, DocRoot, DocHtmlDetails, DocHtmlSummary, DocPlantUmlFile > DocNodeVariant
Definition docnode.h:66
constexpr DocNodeVariant * parent(DocNodeVariant *n)
returns the parent node of a given node n or nullptr if the node has no parent.
Definition docnode.h:1325
contexts_t
bool isFirstChildNode(const T *parent, const DocPara &node)
bool isSeparatedParagraph(const DocSimpleSect &parent, const DocPara &par)
bool isLastChildNode(const T *parent, const DocPara &node)

References ENDDD, ENDLI, ENDTD, FALSE, holds_one_of_alternatives(), INTERDD, INTERLI, INTERTD, isFirstChildNode(), isLastChildNode(), isSeparatedParagraph(), NONE, DocNode::parent(), parent(), STARTDD, STARTLI, STARTTD, and TRUE.

Referenced by HtmlDocVisitor::forceEndParagraph(), HtmlDocVisitor::forceStartParagraph(), and HtmlDocVisitor::operator()().

◆ holds_value()

template<class Node>
bool holds_value ( const Node * val,
const DocNodeVariant & v )
static

Definition at line 1087 of file htmldocvisitor.cpp.

1088{
1089 bool b = std::visit([&](auto &&x) {
1090 //printf("holds_value val=%s (%p) v=%s (%p)\n",
1091 // docNodeName(*val),(void*)val,docNodeName(v),(void *)&x);
1092 return val==static_cast<const DocNode*>(&x);
1093 }, v);
1094 return b;
1095}
Abstract node interface with type information.
Definition docnode.h:81

Referenced by HtmlDocVisitor::forceEndParagraph(), HtmlDocVisitor::forceStartParagraph(), isFirstChildNode(), isLastChildNode(), and isSeparatedParagraph().

◆ insideStyleChangeThatIsOutsideParagraph()

bool insideStyleChangeThatIsOutsideParagraph ( const DocPara * para,
DocNodeList::const_iterator it )
static

Returns TRUE if the child nodes in paragraph para until nodeIndex contain a style change node that is still active and that style change is one that must be located outside of a paragraph, i.e.

it is a center, div, or pre tag. See also bug746162.

Definition at line 2281 of file htmldocvisitor.cpp.

2283{
2284 //printf("insideStyleChangeThatIsOutputParagraph(index=%d)\n",nodeIndex);
2285 int styleMask=0;
2286 bool styleOutsideParagraph=FALSE;
2287 while (!styleOutsideParagraph)
2288 {
2289 const DocNodeVariant *n = &(*it);
2290 const DocStyleChange *sc = std::get_if<DocStyleChange>(n);
2291 if (sc)
2292 {
2293 if (!sc->enable()) // remember styles that has been closed already
2294 {
2295 styleMask|=static_cast<int>(sc->style());
2296 }
2297 bool paraStyle = sc->style()==DocStyleChange::Center ||
2298 sc->style()==DocStyleChange::Div ||
2300 //printf("Found style change %s enabled=%d\n",sc->styleString(),sc->enable());
2301 if (sc->enable() && (styleMask&static_cast<int>(sc->style()))==0 && // style change that is still active
2302 paraStyle
2303 )
2304 {
2305 styleOutsideParagraph=TRUE;
2306 }
2307 }
2308 if (it!=std::begin(para->children()))
2309 {
2310 --it;
2311 }
2312 else
2313 {
2314 break;
2315 }
2316 }
2317 return styleOutsideParagraph;
2318}
DocNodeList & children()
Definition docnode.h:142
Node representing a style change.
Definition docnode.h:264
Style style() const
Definition docnode.h:303
bool enable() const
Definition docnode.h:305

References DocStyleChange::Center, DocCompoundNode::children(), DocStyleChange::Div, DocStyleChange::enable(), FALSE, DocStyleChange::Preformatted, DocStyleChange::style(), and TRUE.

Referenced by HtmlDocVisitor::forceEndParagraph(), and HtmlDocVisitor::forceStartParagraph().

◆ isDocIncludeVisible()

bool isDocIncludeVisible ( const DocInclude & s)
static

Definition at line 181 of file htmldocvisitor.cpp.

182{
183 switch (s.type())
184 {
191 return FALSE;
192 default:
193 return TRUE;
194 }
195}
@ LatexInclude
Definition docnode.h:433
@ DontInclude
Definition docnode.h:433
@ DocbookInclude
Definition docnode.h:435
Type type() const
Definition docnode.h:447

References DocInclude::DocbookInclude, DocInclude::DontInclude, FALSE, DocInclude::LatexInclude, DocInclude::ManInclude, DocInclude::RtfInclude, TRUE, DocInclude::type(), and DocInclude::XmlInclude.

Referenced by isInvisibleNode().

◆ isDocIncOperatorVisible()

bool isDocIncOperatorVisible ( const DocIncOperator & s)
static

Definition at line 197 of file htmldocvisitor.cpp.

198{
199 switch (s.type())
200 {
202 return FALSE;
203 default:
204 return TRUE;
205 }
206}
Type type() const
Definition docnode.h:481

References FALSE, DocIncOperator::Skip, TRUE, and DocIncOperator::type().

Referenced by isInvisibleNode().

◆ isDocVerbatimVisible()

bool isDocVerbatimVisible ( const DocVerbatim & s)
static

Definition at line 166 of file htmldocvisitor.cpp.

167{
168 switch (s.type())
169 {
175 return FALSE;
176 default:
177 return TRUE;
178 }
179}
Type type() const
Definition docnode.h:378

References DocVerbatim::DocbookOnly, FALSE, DocVerbatim::LatexOnly, DocVerbatim::ManOnly, DocVerbatim::RtfOnly, TRUE, DocVerbatim::type(), and DocVerbatim::XmlOnly.

Referenced by isInvisibleNode().

◆ isFirstChildNode()

template<class T>
bool isFirstChildNode ( const T * parent,
const DocPara & node )

Definition at line 1098 of file htmldocvisitor.cpp.

1099{
1100 return !parent->children().empty() && holds_value(&node,parent->children().front());
1101}
static bool holds_value(const Node *val, const DocNodeVariant &v)

References holds_value(), and parent().

Referenced by getParagraphContext().

◆ isInvisibleNode()

bool isInvisibleNode ( const DocNodeVariant & node)
static

Definition at line 208 of file htmldocvisitor.cpp.

209{
210 //printf("isInvisibleNode(%s)\n",docNodeName(node));
211 // skip over white space
212 const DocWhiteSpace *ws = std::get_if<DocWhiteSpace>(&node);
213 if (ws) return true;
214 // skip over image nodes that are not for HTML output
215 const DocImage *di = std::get_if<DocImage>(&node);
216 if (di) return di->type()!=DocImage::Html;
217 // skip over verbatim nodes that are not visible in the HTML output
218 const DocVerbatim *dv = std::get_if<DocVerbatim>(&node);
219 if (dv) return !isDocVerbatimVisible(*dv);
220 // skip over include nodes that are not visible in the HTML output
221 const DocInclude *dinc = std::get_if<DocInclude>(&node);
222 if (dinc) return !isDocIncludeVisible(*dinc);
223 const DocIncOperator *dio = std::get_if<DocIncOperator>(&node);
224 // skip over include operator nodes that are not visible in the HTML output
225 if (dio) return !isDocIncOperatorVisible(*dio);
226 return false;
227}
Node representing an image.
Definition docnode.h:637
Type type() const
Definition docnode.h:642
Node representing a include/dontinclude operator block.
Definition docnode.h:473
Node representing an included text block from file.
Definition docnode.h:431
Node representing a verbatim, unparsed text fragment.
Definition docnode.h:372
Node representing some amount of white space.
Definition docnode.h:350
static bool isDocVerbatimVisible(const DocVerbatim &s)
static bool isDocIncOperatorVisible(const DocIncOperator &s)
static bool isDocIncludeVisible(const DocInclude &s)

References DocImage::Html, isDocIncludeVisible(), isDocIncOperatorVisible(), isDocVerbatimVisible(), and DocImage::type().

Referenced by HtmlDocVisitor::forceEndParagraph(), HtmlDocVisitor::forceStartParagraph(), and HtmlDocVisitor::operator()().

◆ isLastChildNode()

template<class T>
bool isLastChildNode ( const T * parent,
const DocPara & node )

Definition at line 1104 of file htmldocvisitor.cpp.

1105{
1106 return !parent->children().empty() && holds_value(&node,parent->children().back());
1107}

References holds_value(), and parent().

Referenced by getParagraphContext().

◆ isSeparatedParagraph()

bool isSeparatedParagraph ( const DocSimpleSect & parent,
const DocPara & par )

Definition at line 1109 of file htmldocvisitor.cpp.

1110{
1111 const DocNodeList &nodes = parent.children();
1112 auto it = std::find_if(std::begin(nodes),std::end(nodes),[&par](const auto &n) { return holds_value(&par,n); });
1113 if (it==std::end(nodes)) return FALSE;
1114 size_t count = parent.children().size();
1115 auto isSeparator = [](auto &&it_) { return std::get_if<DocSimpleSectSep>(&(*it_))!=nullptr; };
1116 if (count>1 && it==std::begin(nodes)) // it points to first node
1117 {
1118 return isSeparator(std::next(it));
1119 }
1120 else if (count>1 && it==std::prev(std::end(nodes))) // it points to last node
1121 {
1122 return isSeparator(std::prev(it));
1123 }
1124 else if (count>2 && it!=std::begin(nodes) && it!=std::prev(std::end(nodes))) // it points to intermediate node
1125 {
1126 return isSeparator(std::prev(it)) && isSeparator(std::next(it));
1127 }
1128 return false;
1129}

References FALSE, holds_value(), and parent().

Referenced by getParagraphContext().

◆ makeBaseName()

QCString makeBaseName ( const QCString & name)
static

Definition at line 240 of file htmldocvisitor.cpp.

241{
242 QCString baseName = makeShortName(name);
243 int i=baseName.find('.');
244 if (i!=-1)
245 {
246 baseName=baseName.left(i);
247 }
248 return baseName;
249}
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
QCString left(size_t len) const
Definition qcstring.h:214
static QCString makeShortName(const QCString &name)

References QCString::find(), QCString::left(), and makeShortName().

◆ makeShortName()

QCString makeShortName ( const QCString & name)
static

Definition at line 229 of file htmldocvisitor.cpp.

230{
231 QCString shortName = name;
232 int i = shortName.findRev('/');
233 if (i!=-1)
234 {
235 shortName=shortName.mid(i+1);
236 }
237 return shortName;
238}
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:226
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:91

References QCString::findRev(), and QCString::mid().

Referenced by makeBaseName().

◆ mustBeOutsideParagraph()

bool mustBeOutsideParagraph ( const DocNodeVariant & n)
static

Definition at line 117 of file htmldocvisitor.cpp.

118{
119 //printf("mustBeOutsideParagraph(%s)=",docNodeName(n));
122 /* <table> */ DocHtmlTable,
123 /* <h?> */ DocSection, DocHtmlHeader,
124 /* \internal */ DocInternal,
125 /* <div> */ DocInclude, DocSecRefList,
126 /* <hr> */ DocHorRuler,
127 /* <blockquote> */ DocHtmlBlockQuote,
128 /* \parblock */ DocParBlock,
129 /* \dotfile */ DocDotFile,
130 /* \mscfile */ DocMscFile,
131 /* \diafile */ DocDiaFile,
132 /* \plantumlfile */ DocPlantUmlFile,
133 /* <details> */ DocHtmlDetails,
134 /* <summary> */ DocHtmlSummary,
135 DocIncOperator >(n))
136 {
137 return TRUE;
138 }
139 const DocVerbatim *dv = std::get_if<DocVerbatim>(&n);
140 if (dv)
141 {
142 DocVerbatim::Type t = dv->type();
144 return t!=DocVerbatim::HtmlOnly || dv->isBlock();
145 }
146 const DocStyleChange *sc = std::get_if<DocStyleChange>(&n);
147 if (sc)
148 {
149 return sc->style()==DocStyleChange::Preformatted ||
150 sc->style()==DocStyleChange::Div ||
152 }
153 const DocFormula *df = std::get_if<DocFormula>(&n);
154 if (df)
155 {
156 return !df->isInline();
157 }
158 const DocImage *di = std::get_if<DocImage>(&n);
159 if (di)
160 {
161 return !di->isInlineImage();
162 }
163 return FALSE;
164}
Node representing an auto List.
Definition docnode.h:567
Node representing a dia file.
Definition docnode.h:726
Node representing a dot file.
Definition docnode.h:708
Node representing an item of a cross-referenced list.
Definition docnode.h:525
bool isInline() const
Definition docnode.h:532
Node representing a horizontal ruler.
Definition docnode.h:215
Node representing a Html description list.
Definition docnode.h:896
Node Html heading.
Definition docnode.h:868
Node representing a Html list.
Definition docnode.h:995
Node representing a HTML table.
Definition docnode.h:1264
bool isInlineImage() const
Definition docnode.h:649
Node representing a msc file.
Definition docnode.h:717
Node representing a parameter section.
Definition docnode.h:1048
Node representing a uml file.
Definition docnode.h:735
Node representing a list of section references.
Definition docnode.h:954
Node representing a simple list.
Definition docnode.h:985
bool isBlock() const
Definition docnode.h:385
@ JavaDocLiteral
Definition docnode.h:374

References DocStyleChange::Center, DocStyleChange::Div, FALSE, holds_one_of_alternatives(), DocVerbatim::HtmlOnly, DocVerbatim::isBlock(), DocFormula::isInline(), DocImage::isInlineImage(), DocVerbatim::JavaDocCode, DocVerbatim::JavaDocLiteral, DocStyleChange::Preformatted, DocStyleChange::style(), TRUE, and DocVerbatim::type().

Referenced by HtmlDocVisitor::forceEndParagraph(), HtmlDocVisitor::forceStartParagraph(), and HtmlDocVisitor::operator()().

Variable Documentation

◆ g_types

const char g_types[][NUM_HTML_LIST_TYPES] = {"1", "a", "i", "A"}
static

Definition at line 44 of file htmldocvisitor.cpp.

44{"1", "a", "i", "A"};

Referenced by HtmlDocVisitor::operator()().

◆ hex

const char* hex ="0123456789ABCDEF"
static

Definition at line 76 of file htmldocvisitor.cpp.

◆ NUM_HTML_LIST_TYPES

const int NUM_HTML_LIST_TYPES = 4
static

Definition at line 43 of file htmldocvisitor.cpp.

Referenced by HtmlDocVisitor::operator()().