feat: add underline to panels and export

This commit is contained in:
Brendan Hagan
2022-07-26 22:37:57 -04:00
parent 78227a30da
commit 132d8d9351
8 changed files with 47 additions and 19 deletions
+15 -4
View File
@@ -209,7 +209,8 @@ String to_html(const String& str_in, const SymbolFontP& symbol_font, double symb
String str = remove_tag_contents(str_in,_("<sep-soft"));
String ret;
Tag bold (_("<b>"), _("</b>")),
italic(_("<i>"), _("</i>")),
italic(_("<i>"), _("</i>")),
underline(_("<u>"), _("</u>")),
symbol(_("<span class=\"symbol\">"), _("</span>"));
TagStack tags;
String symbols;
@@ -224,7 +225,11 @@ String to_html(const String& str_in, const SymbolFontP& symbol_font, double symb
} else if (is_substr(str, i, _("i"))) {
tags.open (ret, italic);
} else if (is_substr(str, i, _("/i"))) {
tags.close(ret, italic);
tags.close(ret, italic);
} else if (is_substr(str, i, _("u"))) {
tags.open(ret, underline);
} else if (is_substr(str, i, _("/u"))) {
tags.close(ret, underline);
} else if (is_substr(str, i, _("sym"))) {
tags.open (ret, symbol);
} else if (is_substr(str, i, _("/sym"))) {
@@ -300,7 +305,8 @@ String to_bbcode(const String& str_in) {
String str = remove_tag_contents(str_in,_("<sep-soft"));
String ret;
Tag bold (_("[b]"), _("[/b]")),
italic(_("[i]"), _("[/i]"));
italic(_("[i]"), _("[/i]")),
underline(_("[u]"), _("[/u]"));
TagStack tags;
String symbols;
for (size_t i = 0 ; i < str.size() ; ) {
@@ -315,7 +321,12 @@ String to_bbcode(const String& str_in) {
tags.open (ret, italic);
} else if (is_substr(str, i, _("/i"))) {
tags.close(ret, italic);
} /*else if (is_substr(str, i, _("sym"))) {
} else if (is_substr(str, i, _("u"))) {
tags.open(ret, underline);
} else if (is_substr(str, i, _("/u"))) {
tags.close(ret, underline);
}
/*else if (is_substr(str, i, _("sym"))) {
tags.open (ret, symbol);
} else if (is_substr(str, i, _("/sym"))) {
if (!symbols.empty()) {