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
=== modified file 'mainpage/templatetags/wl_markdown.py'
--- mainpage/templatetags/wl_markdown.py 2017-07-06 06:28:44 +0000
+++ mainpage/templatetags/wl_markdown.py 2017-11-14 17:00:34 +0000
@@ -22,6 +22,7 @@
22 raise ImportError, 'Markdown library to old!'22 raise ImportError, 'Markdown library to old!'
23from markdown import markdown23from markdown import markdown
24import re24import re
25import urllib
25import bleach26import bleach
2627
27from BeautifulSoup import BeautifulSoup, NavigableString28from BeautifulSoup import BeautifulSoup, NavigableString
@@ -113,7 +114,7 @@
113114
114 # Check for missing wikilink /wiki/PageName[/additionl/stuff]115 # Check for missing wikilink /wiki/PageName[/additionl/stuff]
115 # Using href because we need cAsEs here116 # Using href because we need cAsEs here
116 pn = tag['href'][6:].split('/', 1)[0]117 pn = urllib.unquote(tag['href'][6:].split('/', 1)[0])
117118
118 if not len(pn): # Wiki root link is not a page119 if not len(pn): # Wiki root link is not a page
119 return {'class': 'wrongLink', 'title': 'This Link misses an articlename'}120 return {'class': 'wrongLink', 'title': 'This Link misses an articlename'}

Subscribers

People subscribed via source and target branches