html.py,style.css: use <pre> with no top-margin on all descriptions

After my last change dealing with this issue, I noticed that descriptions
with <pre> had an extra blank line at the top. Adding top-margin to the
CSS file made this go away, but it also made the <br/> superfluous. Thus,
it is simpler just to have every description use <pre> instead of <br/>.

This should finally resolve everything having to do with the add-on
descriptions.

If I'd noticed that the re module hadn't been imported, I probably wouldn't
have considered URL linking to be important enough to do so. Since I've
already written the code, however, I'll keep it.
This commit is contained in:
Groggy Dice 2014-05-07 06:09:57 -04:00
parent 4584e3daf7
commit 7fb303c57d
2 changed files with 3 additions and 4 deletions

View file

@ -139,9 +139,7 @@ Unit packs, terrain packs, music packs, etc. Usually a (perhaps optional) depend
if described != "(no description)":
described = re.sub(r'(?<![">])http://[\w./?&=%~-]+', r'<a href="\g<0>">\g<0></a>', described)
described = re.sub(r'(?<![\w>"/])(forums?|r|R|wiki)\.wesnoth\.org[\w./?&=%~-]+', r'<a href="http://\g<0>">\g<0>"</a>"', described)
if "\n" in described:
described = "<pre>" + described + "</pre>"
w('<div class="desc"><b>%s</b><br/>%s</div></td>' % (
w('<div class="desc"><b>%s</b><pre>%s</pre></div></td>' % (
name, described))
w("<td><b>%s</b><br/>" % name)
w("Version: %s<br/>" % v("version", "unknown"))

View file

@ -95,7 +95,8 @@ pre {
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
font: inherit
font: inherit;
margin-top: 0;
}
/* tables */