From c364efb60518833a1236492c8b6634a94d2dec5e Mon Sep 17 00:00:00 2001 From: Ralph Thesen Date: Tue, 21 Jan 2025 22:57:52 +0100 Subject: [PATCH] fix: preview of a paragaph with _italic_ markup - added test_preview_italic_bug to reproduce the bug - this fixes #167 --- otterwiki/renderer.py | 2 +- tests/test_preview.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/otterwiki/renderer.py b/otterwiki/renderer.py index 7324dd2..6560d7e 100644 --- a/otterwiki/renderer.py +++ b/otterwiki/renderer.py @@ -32,7 +32,7 @@ from bs4 import BeautifulSoup # the cursor magic word which is ignored by the rendering -cursormagicword = "CuRsoRm4g1cW0Rd" +cursormagicword = "" # # patch mistune table_plugin so that not all the newlines at the end of a table are removed diff --git a/tests/test_preview.py b/tests/test_preview.py index d1c1b59..2eea759 100644 --- a/tests/test_preview.py +++ b/tests/test_preview.py @@ -116,3 +116,14 @@ def test_preview_list_bug(create_app, req_ctx): assert "
  • eins" in data['preview_content'] assert "
  • zwei" in data['preview_content'] assert "
  • drei" in data['preview_content'] + + +def test_preview_italic_bug(create_app, req_ctx): + from otterwiki.wiki import Page + + p = Page("test") + content = """# Header + +_A paragraph_""" + data = p.preview(content=content, cursor_line=3) + assert "A paragraph" in data['preview_content']