-
-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[jarun#807] fixed import in single-parent-folder-tag mode #814
base: master
Are you sure you want to change the base?
Conversation
# dt | ||
# a (could be h3, and continue recursively) | ||
parents = tag.find_parents('dl') | ||
for parent in (parents if use_nested_folder_structure else parents[:1]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the else:
branch and modified this line in the if:
branch (thus ensuring the same code is used for both import-parents-as-tags modes)
@@ -4014,35 +4014,21 @@ def import_html(html_soup: BeautifulSoup, add_parent_folder_as_tag: bool, newtag | |||
desc = comment_tag.find(string=True, recursive=False) | |||
|
|||
if add_parent_folder_as_tag: | |||
# add parent folder as tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this comment (since it was merely quoting the line immediately before it)
@@ -791,7 +791,7 @@ def test_import_html_and_add_parent(): | |||
[ | |||
("http://example11.com", None, ",folder11,", None, 0, True, False), | |||
("http://example121.com", None, ",folder121,", None, 0, True, False), | |||
("http://example12.com", None, None, None, 0, True, False), | |||
("http://example12.com", None, ",folder12,", None, 0, True, False), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corresponds to a snippet (below) that matches the usecase in question
<DT><H3>Folder12</H3><DL><p>
<DT><H3>Folder121</H3><DL><p>
<DT><A HREF="http://example121.com"></A></DT>
</DL><p></DT>
<DT><A HREF="http://example12.com"></A></DT>
fixes #807:
Example
input file
(before)
(after)