Skip to content

Commit

Permalink
refactors to use find to fix #17
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangFahl committed Mar 14, 2021
1 parent 4c68377 commit 367a631
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/wikicms.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ def doFilter(self,html,filterKeys):
# https://stackoverflow.com/questions/5598524/can-i-remove-script-tags-with-beautifulsoup
soup = BeautifulSoup(html,'lxml')
if "parser-output" in filterKeys:
resultset=soup.select('div',{"class": "mw-parser-output"})
if len(resultset)==1:
soup=resultset[0].children.__next__()
parserdiv=soup.find('div',{"class": "mw-parser-output"})
if parserdiv:
soup=parserdiv.children.__next__()
pass
# https://stackoverflow.com/questions/5041008/how-to-find-elements-by-class
if "editsection" in filterKeys:
Expand Down

0 comments on commit 367a631

Please sign in to comment.