Skip to content

Commit

Permalink
Added Spaces before and after lists
Browse files Browse the repository at this point in the history
  • Loading branch information
NieThor committed Aug 17, 2020
1 parent 8459a7f commit a8384f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions VDE web scraper/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ def prettify_string_with_list(tag):
ordered_lists = tag.find_all('ol')
for u_list in unordered_lists:
for li in u_list.find_all('li'):
li.string.replace_with(bullet + f' {li.string}')
li.string.replace_with(' ' + bullet + f' {li.string}')

for o_list in ordered_lists:
for i, li in enumerate(o_list.find_all('li')):
li.string.replace_with(str(i+1) + f'. {li.string}')
li.string.replace_with(' ' + str(i+1) + f'. {li.string}')

return prettify_string(tag.get_text())

Expand Down

0 comments on commit a8384f2

Please sign in to comment.