Skip to content

Commit

Permalink
fix: preview of a paragaph with _italic_ markup
Browse files Browse the repository at this point in the history
- added test_preview_italic_bug to reproduce the bug
- this fixes #167
  • Loading branch information
redimp committed Jan 21, 2025
1 parent bc1ef20 commit c364efb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion otterwiki/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from bs4 import BeautifulSoup

# the cursor magic word which is ignored by the rendering
cursormagicword = "CuRsoRm4g1cW0Rd"
cursormagicword = "<!-- CuRsoRm4g1cW0Rd -->"

#
# patch mistune table_plugin so that not all the newlines at the end of a table are removed
Expand Down
11 changes: 11 additions & 0 deletions tests/test_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,14 @@ def test_preview_list_bug(create_app, req_ctx):
assert "<li>eins" in data['preview_content']
assert "<li>zwei" in data['preview_content']
assert "<li>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 "<em>A paragraph</em>" in data['preview_content']

0 comments on commit c364efb

Please sign in to comment.