Skip to content

Commit c75fa3f

Browse files
committed
fix bug related to changes in beautifulsoup 4.12
1 parent 4aaaf67 commit c75fa3f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

encryptcontent/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,7 @@ def on_post_page(self, output_content, page, config, **kwargs):
572572
cipher_bundle = self.__encrypt_text_aes__(merge_item, str(page.encryptcontent['password']))
573573
encrypted_content = b';'.join(cipher_bundle).decode('ascii')
574574
# Replace initial content with encrypted one
575-
bs4_encrypted_content = BeautifulSoup(encrypted_content, 'html.parser')
576-
item.contents = [bs4_encrypted_content]
575+
item.string = encrypted_content
577576
if item.has_attr('style'):
578577
if isinstance(item['style'], list):
579578
item['style'].append("display:none")
@@ -590,6 +589,7 @@ def on_post_page(self, output_content, page, config, **kwargs):
590589
something_search.insert_before(injector)
591590
injector.append(BeautifulSoup(page.encryptcontent['decrypt_form'], 'html.parser'))
592591
page.encryptcontent['decrypt_form'] = None
592+
593593
output_content = str(soup)
594594

595595
if hasattr(page, 'encryptcontent'):

0 commit comments

Comments
 (0)