Convert markdown titles to html

main
Bob Mottram 2025-12-07 17:32:50 +00:00
parent b965589dc3
commit 0c2b037ec7
2 changed files with 6 additions and 3 deletions

View File

@ -198,7 +198,7 @@ def _get_blog_replies(base_dir: str, http_prefix: str, translate: {},
return ''
def _html_blog_post_markdown(content: str) -> str:
def html_blog_post_markdown(content: str) -> str:
"""Converts any markdown to html
"""
replacements = {
@ -381,12 +381,12 @@ def _html_blog_post_content(debug: bool, session, authorized: bool,
nickname, domain, domain_full,
post_json_object['object']['id'], 0)
# separator between blogs should be centered
# separator between blogs should be centred
if '<center>' not in blog_separator:
blog_separator: str = '<center>' + blog_separator + '</center>'
# convert any markdown
blog_str = _html_blog_post_markdown(blog_str)
blog_str = html_blog_post_markdown(blog_str)
if replies == 0:
blog_str += blog_separator + '\n'

View File

@ -138,6 +138,7 @@ from maps import get_category_from_post
from maps import get_event_time_span_from_post
from session import get_json_valid
from session import get_json
from blog import html_blog_post_markdown
# maximum length for display name within html posts
MAX_DISPLAY_NAME_LENGTH = 42
@ -3117,6 +3118,8 @@ def individual_post_as_html(signing_priv_key_pem: str,
# remove any tabs
content_str = \
content_str.replace('\t', '').replace('\r', '')
# replace any markdown with html
content_str = html_blog_post_markdown(content_str)
# Add bold text
if bold_reading and \
not post_is_blog: