forked from LiveCarta/BookConverter
Add ability to unwrap tags that are in certain tags
This commit is contained in:
@@ -165,10 +165,14 @@ def _tags_to_correspond_livecarta_tag(chapter_tag):
|
|||||||
|
|
||||||
def _unwrap_tags(chapter_tag):
|
def _unwrap_tags(chapter_tag):
|
||||||
"""Function unwrap tags and move id to span"""
|
"""Function unwrap tags and move id to span"""
|
||||||
for tag in LiveCartaConfig.TAGS_TO_UNWRAP:
|
for tag_name in LiveCartaConfig.TAGS_TO_UNWRAP:
|
||||||
for s in chapter_tag.find_all(tag):
|
for tag in chapter_tag.select(tag_name):
|
||||||
_add_span_to_save_ids_for_links(s, chapter_tag)
|
# if tag is a subtag
|
||||||
s.unwrap()
|
if ">" in tag_name:
|
||||||
|
parent = tag.parent
|
||||||
|
tag.parent.attrs.update(tag.attrs)
|
||||||
|
_add_span_to_save_ids_for_links(tag, chapter_tag)
|
||||||
|
tag.unwrap()
|
||||||
|
|
||||||
|
|
||||||
def _remove_headings_content(content_tag, title_of_chapter: str):
|
def _remove_headings_content(content_tag, title_of_chapter: str):
|
||||||
|
|||||||
Reference in New Issue
Block a user