diff options
author | George Hazan <george.hazan@gmail.com> | 2024-10-18 13:42:45 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-10-18 13:42:45 +0300 |
commit | 7eb8c60ca91ed6932f508df9447c981e30bddbcd (patch) | |
tree | a80f4cfb6dc25255109a868ac72fd02e5ea1787e | |
parent | 9f3e29551b636902d5a224c6ef4cc8aba6526810 (diff) |
code optimization
-rw-r--r-- | plugins/NewStory/src/templates.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/plugins/NewStory/src/templates.cpp b/plugins/NewStory/src/templates.cpp index 4a48c1b404..36c6cedadb 100644 --- a/plugins/NewStory/src/templates.cpp +++ b/plugins/NewStory/src/templates.cpp @@ -207,19 +207,11 @@ static void AppendString(CMStringW &buf, const wchar_t *p, ItemData *pItem) }
else if (!wcsncmp(p, L"code]", 5)) {
p += 4;
- buf.AppendFormat(L"<pre>");
- }
- else if (!wcsncmp(p, L"/code]", 6)) {
- p += 5;
- buf.AppendFormat(L"</pre>");
+ buf.AppendFormat(*pEnd ? L"</pre>" : L"<pre>");
}
else if (!wcsncmp(p, L"quote]", 6)) {
p += 5;
- buf.AppendFormat(L"<div class=\"quote\">");
- }
- else if (!wcsncmp(p, L"/quote]", 7)) {
- p += 6;
- buf.AppendFormat(L"</div>");
+ buf.AppendFormat(*pEnd ? L"</div>" : L"<div class=\"quote\">" );
}
else {
buf.AppendChar('[');
|