terrain2wiki: Wrap .string and .aliasof column contents in <code>...

...and use &#124; instead of the Unicode broken bar (fixes bug #19678)

This also extends the vertical bar escaping to the .aliasof column
contents (in case we ever get base terrains with vertical bars)

By using <code> we should be able to stick to byte-accurate contents
without compromising readability, by styling terrain type strings in a
default monospace font suitable for code display (i.e. | and l should be
distinguishable from each other).
This commit is contained in:
Ignacio R. Morelle 2012-05-12 21:11:07 +00:00
parent 0c8990bb98
commit 15510a8dcd

View file

@ -62,14 +62,14 @@ def parse_terrain(data):
data += """|-
| %s
| %s
| %s
| %s
| <code>%s</code>
| <code>%s</code>
| %s
""" % (
"http://svn.gna.org/svn/wesnoth/trunk/data/core/images/terrain/%s.png" % (content['editor_image'] if 'editor_image' in content else content['symbol_image']),
content['editor_name'][4:-1] if 'editor_name' in content else content['name'][4:-1],
content['string'].replace("# wmllint: ignore", "").replace("|", "&brvbar;"),
content['aliasof'] if 'aliasof' in content else "",
content['string'].replace("# wmllint: ignore", "").replace("|", "&#124;"),
content['aliasof'].replace("|", "&#124;") if 'aliasof' in content else "",
content['editor_group'])
data += "|}"