Merge lp:~widelands-dev/widelands-website/correct_link_coloring into lp:widelands-website

Proposed by kaputtnik
Status: Merged
Merged at revision: 476
Proposed branch: lp:~widelands-dev/widelands-website/correct_link_coloring
Merge into: lp:widelands-website
Diff against target: 20 lines (+2/-1)
1 file modified
mainpage/templatetags/wl_markdown.py (+2/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands-website/correct_link_coloring
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+333697@code.launchpad.net

Description of the change

A small change...

Use urllib.unquote() to get a clean name for a wikiarticle, so a database query will find it.

To post a comment you must log in.
Revision history for this message
GunChleoc (gunchleoc) wrote :

LGTM - ship it :)

review: Approve
Revision history for this message
kaputtnik (franku) wrote :

Thanks :-)
Merged and deployed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mainpage/templatetags/wl_markdown.py'
2--- mainpage/templatetags/wl_markdown.py 2017-07-06 06:28:44 +0000
3+++ mainpage/templatetags/wl_markdown.py 2017-11-14 17:00:34 +0000
4@@ -22,6 +22,7 @@
5 raise ImportError, 'Markdown library to old!'
6 from markdown import markdown
7 import re
8+import urllib
9 import bleach
10
11 from BeautifulSoup import BeautifulSoup, NavigableString
12@@ -113,7 +114,7 @@
13
14 # Check for missing wikilink /wiki/PageName[/additionl/stuff]
15 # Using href because we need cAsEs here
16- pn = tag['href'][6:].split('/', 1)[0]
17+ pn = urllib.unquote(tag['href'][6:].split('/', 1)[0])
18
19 if not len(pn): # Wiki root link is not a page
20 return {'class': 'wrongLink', 'title': 'This Link misses an articlename'}

Subscribers

People subscribed via source and target branches