diff options
author | albert-github <albert.tests@gmail.com> | 2019-10-20 11:41:13 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2019-10-20 11:41:13 (GMT) |
commit | 36c549da50d685fd8be82e88cb63db5cf13c57f5 (patch) | |
tree | 5422261c9398a0d395dced83600b66b769c76bbd /src/docparser.h | |
parent | d0d748aee7fdd0469479d7feff16f337322a2175 (diff) | |
download | Doxygen-36c549da50d685fd8be82e88cb63db5cf13c57f5.zip Doxygen-36c549da50d685fd8be82e88cb63db5cf13c57f5.tar.gz Doxygen-36c549da50d685fd8be82e88cb63db5cf13c57f5.tar.bz2 |
Warning with XML / HTML style commands
When having a problem like:
```
/// set <var> var start_interp </em>
void fie(void);
/// set <i> i start_interp
void fie1(void);
```
we get the warnings (doubles omitted):
```
.../bb.h:5: warning: end of comment block while expecting command </em>
```
so
- discrepancy between `<var>` and closing `</em>` is not reported, but wrong for as opening and closing tag should have the same tag name.
- the missing `</i>` is reported as a missing `</em>`
The problems here are due to the fact that `<var>`, `<i>` and `<em>` share all the style `HTML_EMPHASIS`, this problem has been fixed by adding the used tag name to the style information and testing o
n the name and not the style type.
The result is now:
```
.../bb.h:1: warning: found </em> tag while expecting </var>
.../bb.h:2: warning: end of comment block while expecting command </var>
.../bb.h:5: warning: end of comment block while expecting command </i>
```
so now the real problems are reported.
Diffstat (limited to 'src/docparser.h')
-rw-r--r-- | src/docparser.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/docparser.h b/src/docparser.h index 02fe135..d252182 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -388,10 +388,10 @@ class DocStyleChange : public DocNode Ins = (1<<13) }; - DocStyleChange(DocNode *parent,uint position,Style s,bool enable, + DocStyleChange(DocNode *parent,uint position,Style s,QCString tagName,bool enable, const HtmlAttribList *attribs=0) : m_position(position), m_style(s), m_enable(enable) - { m_parent = parent; if (attribs) m_attribs=*attribs; } + { m_parent = parent; if (attribs) m_attribs=*attribs; m_tagName = tagName.lower();} Kind kind() const { return Kind_StyleChange; } Style style() const { return m_style; } const char *styleString() const; @@ -399,12 +399,14 @@ class DocStyleChange : public DocNode uint position() const { return m_position; } void accept(DocVisitor *v) { v->visit(this); } const HtmlAttribList &attribs() const { return m_attribs; } + QCString tagName() const { return m_tagName; } private: uint m_position; Style m_style; bool m_enable; HtmlAttribList m_attribs; + QCString m_tagName; }; /** Node representing a special symbol */ |