diff options
author | albert-github <albert.tests@gmail.com> | 2018-08-09 17:49:58 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2018-08-09 17:49:58 (GMT) |
commit | 4682b91364247aafe66b6af472e321511e115e7c (patch) | |
tree | e267667bec90cebd6a38c757c7b2047f7d7e22ec /src/docparser.cpp | |
parent | 69829b043fb36a56d194dc31522b694379636855 (diff) | |
download | Doxygen-4682b91364247aafe66b6af472e321511e115e7c.zip Doxygen-4682b91364247aafe66b6af472e321511e115e7c.tar.gz Doxygen-4682b91364247aafe66b6af472e321511e115e7c.tar.bz2 |
Inline images
Create the possibility of inline images with the `\image` command by means of the option `inline`.
Diffstat (limited to 'src/docparser.cpp')
-rw-r--r-- | src/docparser.cpp | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp index 7e050b3..4cf7c4e 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -2962,10 +2962,10 @@ void DocVhdlFlow::parse() //--------------------------------------------------------------------------- DocImage::DocImage(DocNode *parent,const HtmlAttribList &attribs,const QCString &name, - Type t,const QCString &url) : + Type t,const QCString &url, const bool inlineImage) : m_attribs(attribs), m_name(name), m_type(t), m_relPath(g_relPath), - m_url(url) + m_url(url), m_inlineImage(inlineImage) { m_parent = parent; } @@ -5065,13 +5065,50 @@ void DocPara::handleIncludeOperator(const QCString &cmdName,DocIncOperator::Type void DocPara::handleImage(const QCString &cmdName) { QCString saveCmdName = cmdName; + bool inlineImage = FALSE; int tok=doctokenizerYYlex(); if (tok!=TK_WHITESPACE) { - warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command", + if (tok==TK_WORD) + { + if (g_token->name == "{") + { + while ((tok=doctokenizerYYlex())==TK_WHITESPACE); + if (g_token->name != "}") // non-empty option string + { + if (g_token->name.lower() != "inline") + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"currently only 'inline' suported as option of %s command", + qPrint(saveCmdName)); + } + else + { + inlineImage = TRUE; + } + while ((tok=doctokenizerYYlex())==TK_WHITESPACE); + } + if (!((tok==TK_WORD) && (g_token->name == "}"))) + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"expected closing '}' at option of %s command", + qPrint(saveCmdName)); + return; + } + tok=doctokenizerYYlex(); + if (tok!=TK_WHITESPACE) + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command with option", + qPrint(saveCmdName)); + return; + } + } + } + else + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"expected whitespace after %s command", qPrint(saveCmdName)); - return; + return; + } } tok=doctokenizerYYlex(); if (tok!=TK_WORD && tok!=TK_LNKWORD) @@ -5110,7 +5147,7 @@ void DocPara::handleImage(const QCString &cmdName) return; } HtmlAttribList attrList; - DocImage *img = new DocImage(this,attrList,findAndCopyImage(g_token->name,t),t); + DocImage *img = new DocImage(this,attrList,findAndCopyImage(g_token->name,t),t,"",inlineImage); m_children.append(img); img->parse(); } |