diff options
author | albert-github <albert.tests@gmail.com> | 2019-04-04 12:43:57 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2019-04-04 12:43:57 (GMT) |
commit | 83db204cd8839b0bbe49e9ba1dc90f7519e34f71 (patch) | |
tree | dfcbdeebcf380f2a71228f6fb80b893f46503a6d /src/docparser.cpp | |
parent | 16d025c8a08b485f5d43ade0986d716bd6aa06f8 (diff) | |
download | Doxygen-83db204cd8839b0bbe49e9ba1dc90f7519e34f71.zip Doxygen-83db204cd8839b0bbe49e9ba1dc90f7519e34f71.tar.gz Doxygen-83db204cd8839b0bbe49e9ba1dc90f7519e34f71.tar.bz2 |
Adding HTML tags ins and del
Github does not support the `<u>` tag for underlined text, in HTML there exists the tag `<ins>`. On https://www.w3schools.com/tags/tag_ins.asp is written:
The `<ins>` tag defines a text that has been inserted into a document.
Browsers will normally strike a line through deleted text and underline inserted text.
Most browsers will display the `<ins>` element with the following default values:
```
ins {
text-decoration: underline;
}
```
analogous there exists the tag `<del>` (https://www.w3schools.com/tags/tag_del.asp):
The `<del>` tag defines text that has been deleted from a document.
Browsers will normally strike a line through deleted text and underline inserted text.
Most browsers will display the `<del>` element with the following default values:
```
del {
text-decoration: line-through;
}
```
Definitions analogue to the underline and strike through tag the implementation for the other formats has been chosen.
Diffstat (limited to 'src/docparser.cpp')
-rw-r--r-- | src/docparser.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp index 1c8479b..bba27a3 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -1095,7 +1095,9 @@ const char *DocStyleChange::styleString() const case DocStyleChange::Div: return "div"; case DocStyleChange::Span: return "span"; case DocStyleChange::Strike: return "strike"; + case DocStyleChange::Del: return "del"; case DocStyleChange::Underline: return "u"; + case DocStyleChange::Ins: return "ins"; } return "<invalid>"; } @@ -1625,6 +1627,16 @@ reparsetoken: handleStyleLeave(parent,children,DocStyleChange::Strike,tokenName); } break; + case HTML_DEL: + if (!g_token->endTag) + { + handleStyleEnter(parent,children,DocStyleChange::Del,&g_token->attribs); + } + else + { + handleStyleLeave(parent,children,DocStyleChange::Del,tokenName); + } + break; case HTML_UNDERLINE: if (!g_token->endTag) { @@ -1635,6 +1647,16 @@ reparsetoken: handleStyleLeave(parent,children,DocStyleChange::Underline,tokenName); } break; + case HTML_INS: + if (!g_token->endTag) + { + handleStyleEnter(parent,children,DocStyleChange::Ins,&g_token->attribs); + } + else + { + handleStyleLeave(parent,children,DocStyleChange::Ins,tokenName); + } + break; case HTML_CODE: case XML_C: if (!g_token->endTag) @@ -6041,9 +6063,15 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta case HTML_STRIKE: handleStyleEnter(this,m_children,DocStyleChange::Strike,&g_token->attribs); break; + case HTML_DEL: + handleStyleEnter(this,m_children,DocStyleChange::Del,&g_token->attribs); + break; case HTML_UNDERLINE: handleStyleEnter(this,m_children,DocStyleChange::Underline,&g_token->attribs); break; + case HTML_INS: + handleStyleEnter(this,m_children,DocStyleChange::Ins,&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 @@ -6456,9 +6484,15 @@ int DocPara::handleHtmlEndTag(const QCString &tagName) case HTML_STRIKE: handleStyleLeave(this,m_children,DocStyleChange::Strike,"strike"); break; + case HTML_DEL: + handleStyleLeave(this,m_children,DocStyleChange::Del,"del"); + break; case HTML_UNDERLINE: handleStyleLeave(this,m_children,DocStyleChange::Underline,"u"); break; + case HTML_INS: + handleStyleLeave(this,m_children,DocStyleChange::Ins,"ins"); + break; case HTML_CODE: handleStyleLeave(this,m_children,DocStyleChange::Code,"code"); break; |