Skip to content

Commit

Permalink
html.py,style.css: use <pre> with no top-margin on all descriptions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
groggyd88 committed May 7, 2014
1 parent 4584e3d commit 7fb303c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions data/tools/addon_manager/html.py
Expand Up @@ -139,9 +139,7 @@ def w(x):
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"))
Expand Down
3 changes: 2 additions & 1 deletion data/tools/addon_manager/style.css
Expand Up @@ -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 */
Expand Down

0 comments on commit 7fb303c

Please sign in to comment.