From 43adc502df6cac22b8857b57b85eab63d8fd4b99 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 16 Sep 2024 18:34:21 +0300 Subject: NS: added parsing of [color=] BBCode --- plugins/NewStory/src/templates.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'plugins/NewStory') diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp index 7c3e091057..7707e742b0 100644 --- a/plugins/NewStory/src/templates.cpp +++ b/plugins/NewStory/src/templates.cpp @@ -189,6 +189,20 @@ static void AppendString(CMStringW &buf, const wchar_t *p, ItemData *pItem) } else p--; } + else if (!wcsncmp(p, L"color=", 6)) { + p += 6; + + if (auto *p1 = wcschr(p, ']')) { + CMStringW wszColor(p, int(p1 - p)); + buf.AppendFormat(L"", color2html(wcstoul(wszColor, 0, 16))); + p = p1; + } + else p--; + } + else if (!wcsncmp(p, L"color]", 6)) { + p += 5; + buf.AppendFormat(L""); + } else if (!wcsncmp(p, L"code]", 5)) { p += 5; -- cgit v1.2.3