summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libutil.cc
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2013-12-12 01:11:07 +0100
committerRaphael Langella <raphael.langella@gmail.com>2013-12-12 23:37:01 +0100
commitf44b2e128bd139398f29464d0f6a42bc173e3b96 (patch)
tree41286c2b7c1c367b159e6acb72be266f48056679 /crawl-ref/source/libutil.cc
parentb10374be2ac5cf9d1ed63725d9aed7b297e928eb (diff)
downloadcrawl-ref-f44b2e128bd139398f29464d0f6a42bc173e3b96.tar.gz
crawl-ref-f44b2e128bd139398f29464d0f6a42bc173e3b96.zip
[txc] Allow breaking lines between 2 tags.
This helps readability quite a lot. Although it means that putting a whitespace between 2 tags should be avoided when possible, because it might be removed on unwrap (both by txc and crawl), if the line break happens to be on this specific whitespace. Quite unlikely, but if it does happen, it can be fixed by using a non-breaking space (0xA0). Note that it works by inserting a line feed (\f) between tags which is later removed. This makes lines containing consecutive tags to have a slightly shorter maximal length.
Diffstat (limited to 'crawl-ref/source/libutil.cc')
-rw-r--r--crawl-ref/source/libutil.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc
index 6a257ee353..19c822cf98 100644
--- a/crawl-ref/source/libutil.cc
+++ b/crawl-ref/source/libutil.cc
@@ -1125,6 +1125,8 @@ string unwrap_desc(string desc)
// Indented lines are pre-formatted.
desc = replace_all(desc, "\n ", "\\n ");
+ // Don't add whitespaces between tags
+ desc = replace_all(desc, ">\n<", "><");
// Newlines are still whitespace.
desc = replace_all(desc, "\n", " ");
// Can force a newline with a literal "\n".