diff --git a/kjvstudy_org/server.py b/kjvstudy_org/server.py index 4f918aa..e05370e 100644 --- a/kjvstudy_org/server.py +++ b/kjvstudy_org/server.py @@ -185,14 +185,22 @@ templates = Jinja2Templates(directory=str(templates_dir)) # Register custom Jinja2 filters templates.env.filters['slugify'] = create_slug -def markdown_to_html(text): - """Convert simple markdown to HTML (bold, italic, and paragraphs).""" +def markdown_inline(text): + """Convert inline markdown to HTML (bold and italic only, no paragraph wrapping).""" if not text: return text # Convert **bold** to bold (must be done before italic) text = re.sub(r'\*\*(.+?)\*\*', r'\1', text) # Convert *italic* to italic text = re.sub(r'\*(.+?)\*', r'\1', text) + return text + +def markdown_to_html(text): + """Convert simple markdown to HTML (bold, italic, and paragraphs).""" + if not text: + return text + # First apply inline markdown + text = markdown_inline(text) # Convert paragraphs (split on double newlines) paragraphs = text.split('\n\n') # Always wrap in

tags @@ -200,6 +208,7 @@ def markdown_to_html(text): return text templates.env.filters['md'] = markdown_to_html +templates.env.filters['mdi'] = markdown_inline # Initialize templates for route modules init_api_templates(templates) diff --git a/kjvstudy_org/templates/book.html b/kjvstudy_org/templates/book.html index cf73642..8f4d4c6 100644 --- a/kjvstudy_org/templates/book.html +++ b/kjvstudy_org/templates/book.html @@ -372,7 +372,7 @@ document.addEventListener('DOMContentLoaded', function() {