trim whitespaces and the line end (#11)

trim whitespaces and the line end

Depends-On: #12

Reviewed-by: OpenTelekomCloud Bot <None>
Reviewed-by: Vladimir Hasko <vladimirhasko@gmail.com>
This commit is contained in:
Artem Goncharov 2022-05-10 13:16:55 +02:00 committed by GitHub
parent dfe3039259
commit 8ee7373ddf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -309,7 +309,7 @@ class OTCDocConvertor:
f"temp/{target}.tmp"), 'w') as writer:
# if f.name not in [
# ]:
# continue
# continue
logging.info(f"Pre-Processing {f} as {target}")
content = reader.read()
soup = bs4.BeautifulSoup(content, "lxml")
@ -389,6 +389,7 @@ class OTCDocConvertor:
processed_line = re.sub(
r'.. code:: codeblock$',
r'.. code-block::', processed_line)
processed_line = re.sub(r'[ \t]*$', '', processed_line)
writer.write(processed_line)
# Generate indexes