diff --git a/src/epub_converter/html_epub_preprocessor.py b/src/epub_converter/html_epub_preprocessor.py
index 627d1f1..9f776c3 100644
--- a/src/epub_converter/html_epub_preprocessor.py
+++ b/src/epub_converter/html_epub_preprocessor.py
@@ -209,7 +209,7 @@ def _preprocess_code_tags(chapter_tag: BeautifulSoup):
"""
Function
- transform , , tags into span
- - add code style to this tags
+ - add code style to this tags (if there is no)
Parameters
----------
chapter_tag: Tag, soup object
@@ -222,10 +222,10 @@ def _preprocess_code_tags(chapter_tag: BeautifulSoup):
for code in chapter_tag.find_all(re.compile("code|kbd|var")):
if not code.parent.name == "pre":
code.name = "span"
+ if not code.attrs.get("style"):
+ code.attrs["style"] = "font-size: 14px; font-family: courier new,courier,monospace;"
continue
- # if tag isn"t in pre and doesn"t have style
- if not code.attrs.get("style"):
- code.attrs["style"] = "font-size: 14px; font-family: courier new,courier,monospace;"
+
def _preprocess_pre_tags(chapter_tag: BeautifulSoup):