Skip to content

Commit c4c8705

Browse files
committed
Fix encryption of an empty htlm element
1 parent bfdf15a commit c4c8705

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Install the package from source with pip:
3434
```bash
3535
cd mkdocs-encryptcontent-plugin/
3636
python3 setup.py sdist bdist_wheel
37-
pip3 install dist/mkdocs_encryptcontent_plugin-0.0.11-py3-none-any.whl
37+
pip3 install dist/mkdocs_encryptcontent_plugin-0.0.12-py3-none-any.whl
3838
```
3939

4040
Enable the plugin in your `mkdocs.yml`:

encryptcontent/plugin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,10 @@ def on_post_page(self, output_content, page, config, **kwargs):
251251
# Merge the content in case there are several elements
252252
if len(item.contents) > 1:
253253
merge_item = ''.join([str(s) for s in item.contents])
254-
else:
254+
elif len(item.contents) == 1:
255255
merge_item = item.contents[0]
256+
else:
257+
merge_item = ""
256258
# Encrypt childs items on target tags with page password
257259
cipher_bundle = self.__encrypt_text_aes__(merge_item, page.password)
258260
encrypted_content = b';'.join(cipher_bundle).decode('ascii')

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def read(fname):
1111

1212
setup(
1313
name='mkdocs-encryptcontent-plugin',
14-
version='0.0.11',
14+
version='0.0.12',
1515
author='CoinK0in',
1616
author_email='[email protected]',
1717
description='A MkDocs plugin that encrypt/decrypt markdown content with AES',

0 commit comments

Comments
 (0)