summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/format.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2014-03-07 08:35:42 -0500
committerNeil Moore <neil@s-z.org>2014-03-07 08:39:25 -0500
commit9185c9f764d8ae2d72663116d03d2834e0dfad02 (patch)
treecceb32934b65213156a4d4add757a8ed2d6a77b7 /crawl-ref/source/format.cc
parent83871be09f809dd534443d56fc15956625fa7946 (diff)
downloadcrawl-ref-9185c9f764d8ae2d72663116d03d2834e0dfad02.tar.gz
crawl-ref-9185c9f764d8ae2d72663116d03d2834e0dfad02.zip
Also display mismatched closing colour tags.
Diffstat (limited to 'crawl-ref/source/format.cc')
-rw-r--r--crawl-ref/source/format.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/crawl-ref/source/format.cc b/crawl-ref/source/format.cc
index 835ed16d66..a62df240f4 100644
--- a/crawl-ref/source/format.cc
+++ b/crawl-ref/source/format.cc
@@ -195,11 +195,14 @@ void formatted_string::parse_string1(const string &s, formatted_string &fs,
if (revert_colour)
{
- if (colour_stack.size() > 1)
+ const int endcolour = get_colour(tagtext);
+
+ if (colour_stack.size() > 1 && endcolour == colour_stack.back())
colour_stack.pop_back();
else
{
- // If we have an extra tag, display it as a warning.
+ // If this was the only tag, or the colour didn't match
+ // the one we are popping, display the tag as a warning.
fs.textcolor(LIGHTRED);
fs.cprintf("</%s>", tagtext.c_str());
}