diff options
Diffstat (limited to 'src/docparser.cpp')
-rw-r--r-- | src/docparser.cpp | 84 |
1 files changed, 75 insertions, 9 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp index 0cb4ea3..b39b80e 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -26,6 +26,7 @@ #include <qdict.h> #include <qregexp.h> #include <ctype.h> +#include <qcstringlist.h> #include "doxygen.h" #include "debug.h" @@ -146,6 +147,9 @@ struct DocParserContext static QStack<DocParserContext> g_parserStack; //--------------------------------------------------------------------------- +static void handleImg(DocNode *parent,QList<DocNode> &children,const HtmlAttribList &tagHtmlAttribs); + +//--------------------------------------------------------------------------- static void docParserPushContext(bool saveParamInfo=TRUE) { //QCString indent; @@ -1047,16 +1051,18 @@ const char *DocStyleChange::styleString() const { switch (m_style) { - case DocStyleChange::Bold: return "b"; - case DocStyleChange::Italic: return "em"; - case DocStyleChange::Code: return "code"; - case DocStyleChange::Center: return "center"; - case DocStyleChange::Small: return "small"; - case DocStyleChange::Subscript: return "subscript"; - case DocStyleChange::Superscript: return "superscript"; - case DocStyleChange::Preformatted: return "pre"; + case DocStyleChange::Bold: return "b"; + case DocStyleChange::Italic: return "em"; + case DocStyleChange::Code: return "code"; + case DocStyleChange::Center: return "center"; + case DocStyleChange::Small: return "small"; + case DocStyleChange::Subscript: return "subscript"; + case DocStyleChange::Superscript: return "superscript"; + case DocStyleChange::Preformatted: return "pre"; case DocStyleChange::Div: return "div"; case DocStyleChange::Span: return "span"; + case DocStyleChange::Strike: return "strike"; + case DocStyleChange::Underline: return "u"; } return "<invalid>"; } @@ -1582,6 +1588,26 @@ reparsetoken: handleStyleLeave(parent,children,DocStyleChange::Bold,tokenName); } break; + case HTML_STRIKE: + if (!g_token->endTag) + { + handleStyleEnter(parent,children,DocStyleChange::Strike,&g_token->attribs); + } + else + { + handleStyleLeave(parent,children,DocStyleChange::Strike,tokenName); + } + break; + case HTML_UNDERLINE: + if (!g_token->endTag) + { + handleStyleEnter(parent,children,DocStyleChange::Underline,&g_token->attribs); + } + else + { + handleStyleLeave(parent,children,DocStyleChange::Underline,tokenName); + } + break; case HTML_CODE: case XML_C: if (!g_token->endTag) @@ -1643,6 +1669,10 @@ reparsetoken: handleStyleLeave(parent,children,DocStyleChange::Small,tokenName); } break; + case HTML_IMG: + if (!g_token->endTag) + handleImg(parent,children,g_token->attribs); + break; default: return FALSE; break; @@ -5197,7 +5227,31 @@ void DocPara::handleInclude(const QCString &cmdName,DocInclude::Type t) { DBG(("handleInclude(%s)\n",qPrint(cmdName))); int tok=doctokenizerYYlex(); - if (tok!=TK_WHITESPACE) + if (tok==TK_WORD && g_token->name=="{") + { + doctokenizerYYsetStateOptions(); + tok=doctokenizerYYlex(); + doctokenizerYYsetStatePara(); + QCStringList optList=QCStringList::split(",",g_token->name); + if (t==DocInclude::Include && optList.contains("lineno")) + { + t = DocInclude::IncWithLines; + } + else if (t==DocInclude::Snippet && optList.contains("lineno")) + { + t = DocInclude::SnipWithLines; + } + else if (t==DocInclude::Include && optList.contains("doc")) + { + t = DocInclude::IncludeDoc; + } + else if (t==DocInclude::Snippet && optList.contains("doc")) + { + t = DocInclude::SnippetDoc; + } + tok=doctokenizerYYlex(); + } + else if (tok!=TK_WHITESPACE) { warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command", qPrint(cmdName)); @@ -5906,6 +5960,12 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta case HTML_BOLD: handleStyleEnter(this,m_children,DocStyleChange::Bold,&g_token->attribs); break; + case HTML_STRIKE: + handleStyleEnter(this,m_children,DocStyleChange::Strike,&g_token->attribs); + break; + case HTML_UNDERLINE: + handleStyleEnter(this,m_children,DocStyleChange::Underline,&g_token->attribs); + break; case HTML_CODE: if (/*getLanguageFromFileName(g_fileName)==SrcLangExt_CSharp ||*/ g_xmlComment) // for C# source or inside a <summary> or <remark> section we @@ -6315,6 +6375,12 @@ int DocPara::handleHtmlEndTag(const QCString &tagName) case HTML_BOLD: handleStyleLeave(this,m_children,DocStyleChange::Bold,"b"); break; + case HTML_STRIKE: + handleStyleLeave(this,m_children,DocStyleChange::Strike,"strike"); + break; + case HTML_UNDERLINE: + handleStyleLeave(this,m_children,DocStyleChange::Underline,"u"); + break; case HTML_CODE: handleStyleLeave(this,m_children,DocStyleChange::Code,"code"); break; |