Formatting within code sections

main
Bob Mottram 2022-06-27 16:13:23 +01:00
parent f707a4f4e1
commit 7d4addfac8
2 changed files with 12 additions and 1 deletions

View File

@ -21,6 +21,7 @@
--header-bg-color: #282c37; --header-bg-color: #282c37;
--main-bg-color: #282c37; --main-bg-color: #282c37;
--post-bg-color: #282c37; --post-bg-color: #282c37;
--code-color: lightblue;
--column-left-color: #282c37; --column-left-color: #282c37;
--link-bg-color: #282c37; --link-bg-color: #282c37;
--dropdown-fg-color: #dddddd; --dropdown-fg-color: #dddddd;
@ -127,6 +128,7 @@
--quote-font-size-mobile: 120%; --quote-font-size-mobile: 120%;
--quote-font-size-tiny: 60%; --quote-font-size-tiny: 60%;
--line-spacing: 180%; --line-spacing: 180%;
--code-spacing: 100%;
--line-spacing-newswire: 120%; --line-spacing-newswire: 120%;
--newswire-item-moderated-color: white; --newswire-item-moderated-color: white;
--newswire-date-moderated-color: white; --newswire-date-moderated-color: white;
@ -248,6 +250,12 @@ body, html {
image-rendering: var(--rendering); image-rendering: var(--rendering);
} }
code {
color: var(--code-color);
white-space: pre;
line-height: var(--code-spacing);
}
audio { audio {
width: 100%; width: 100%;
} }

View File

@ -335,7 +335,10 @@ def markdown_to_html(markdown: str) -> str:
} }
for line in lines_list: for line in lines_list:
if ctr > 0: if ctr > 0:
html_str += '<br>\n' if not code_section:
html_str += '<br>\n'
else:
html_str += '\n'
# avoid code sections # avoid code sections
if not code_section: if not code_section: