diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2018-12-23 19:08:19 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2018-12-23 19:08:19 (GMT) |
commit | c3ee766d0ad5721c753581e7f87026614c0730e1 (patch) | |
tree | 7fa6ad9bbb5c3fcd8938bec8fea9b1b0a36e397f /src/latexdocvisitor.cpp | |
parent | 200353a0886f5ee20101b7af4b55af498adc495f (diff) | |
download | Doxygen-c3ee766d0ad5721c753581e7f87026614c0730e1.zip Doxygen-c3ee766d0ad5721c753581e7f87026614c0730e1.tar.gz Doxygen-c3ee766d0ad5721c753581e7f87026614c0730e1.tar.bz2 |
Improved robustness of the emoji feature
Changes:
- Use of `@emoji name` instead of `:name:`
- Support only GitHub emojis (i.e. without spaces or special characters in the name)
- Provided script to download images for LaTeX support.
- XML output now has <emoji> tag with name an unicode sequence.
Diffstat (limited to 'src/latexdocvisitor.cpp')
-rw-r--r-- | src/latexdocvisitor.cpp | 44 |
1 files changed, 5 insertions, 39 deletions
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 3bc768b..732cd49 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -243,49 +243,15 @@ void LatexDocVisitor::visit(DocSymbol *s) void LatexDocVisitor::visit(DocEmoji *s) { if (m_hide) return; - const char *res_text = EmojiEntityMapper::instance()->text(s->emoji()); - if (res_text) + QCString emojiName = EmojiEntityMapper::instance()->name(s->index()); + if (!emojiName.isEmpty()) { - const char *res_code = EmojiEntityMapper::instance()->code(s->emoji()); - m_t << "\\doxygenemoji{"; - filter(res_text); - m_t << "}{"; - m_t << res_code; - m_t << "}{"; - const char *p = res_code; - char res[10]; - int i = 0; - bool first = TRUE; - while (*p) - { - switch(*p) - { - case '&': case '#': case 'x': - break; - case ';': - res[i] = '\0'; - if (!first) m_t << "-"; - m_t << res; - first = FALSE; - i = 0; - break; - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - res[i] = *p; - i++; - break; - case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - res[i] = *p -'a' + 'A'; // so it is uppercase - i++; - break; - } - p++; - } - m_t << "}"; + QCString imageName=emojiName.mid(1,emojiName.length()-2); // strip : at start and end + m_t << "\\doxygenemoji{" << emojiName << "}{" << imageName << "}"; } else { - err("LaTeX: non supported Emoji-entity found: %s\n",EmojiEntityMapper::instance()->html(s->emoji())); + m_t << s->name(); } } |