Skip to content

Commit

Permalink
Made it so 'a' tags now appear as [enllaçtrencat] on certain circumst…
Browse files Browse the repository at this point in the history
…ances
  • Loading branch information
Anna Nicolas committed Jul 8, 2024
1 parent 7f0576b commit 0a3e6c0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/genweb6/core/browser/JSON_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ def read_JSON(self,JSON_file):
for tag in allTags:
tag['class'] = ''
tag['style'] = ''
if tag.name == 'a' and tag.get('href') and 'http' not in tag.get('href') or tag.name == 'a' and not tag.get('href'):
for content in tag.contents:
if isinstance(content, str):
content.replaceWith(content + ' [enllaçtrencat]')
data["text"] = RichTextValue(str(soup), 'text/html', 'text/x-html-safe')
logging.info(soup.prettify())
offer = createContentInContainer(container, "Document", **data)
offer.setEffectiveDate(dt_start_of_day(datetime.datetime.today() + datetime.timedelta(1)))
offer.setExpirationDate(dt_end_of_day(datetime.datetime.today() + datetime.timedelta(365)))
Expand Down

0 comments on commit 0a3e6c0

Please sign in to comment.