Merge lp:~widelands-dev/widelands-website/update_beautifulsoup4 into lp:widelands-website
Status: | Merged |
---|---|
Merged at revision: | 507 |
Proposed branch: | lp:~widelands-dev/widelands-website/update_beautifulsoup4 |
Merge into: | lp:widelands-website |
Diff against target: |
434 lines (+153/-113) 5 files modified
mainpage/templatetags/wl_markdown.py (+114/-91) mainpage/views.py (+1/-1) pip_requirements.txt (+2/-1) pybb/util.py (+35/-14) settings.py (+1/-6) |
To merge this branch: | bzr merge lp:~widelands-dev/widelands-website/update_beautifulsoup4 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Widelands Developers | Pending | ||
Review via email: mp+358571@code.launchpad.net |
Commit message
Update BeautifulSoup and make needed changes
Description of the change
Update BeautifulSoup3 to BeautifulSoup4. This is a prerequisite for the python update.
In contrary to bs3, bs4 escapes all (python) strings, so it is not possible anymore to apply just a (unicode)string like "<a href://
This branch takes care of this and modifies the used code to use BeautifulSoup4 objects. The new code may can be smarter, but i find it understandable.
I have also refactored some variables and comments.
The rendering times are close to equal in comparison with BeautifulSoup3. E.g.
For the Developers page: /developers/
bs3: ~0.62s
bs4: ~0.45s
For /wiki/WikiSyntax/
bs3: ~0.14s
bs4: ~0.14s
The Regular expression for finding pasted plain text-links is tested here: https:/
I have also removed the SMILEY_PREESCAPING things, because it works as is right now. The only problem is: The 'develish' smiley won't work if it is placed as the first characters. I am in favor to replace '>:-)' with ']:-)' to fix this. Any remarks for this?
2 comments.
Since smilies aren't being used much, I'd be OK with changing the code for the devil.