Skip to content

Epub error due to escaped asterisk #91

Closed

Description

@ka-m-be

Escaped asterisks, \*, are rendered as one opening , but since it represents a literal asterisk, not markdown formatting there's no closing .

In tables, this leads to "This page contains the following errors:error on line 168 at column 10517: Opening and ending tag mismatch: em line 168 and td" in MacOS Books.

Outside of tables, '\*' is rendered literally, i.e. with \, which is also not correct.

Activity

  1. rogerdigital commented on Sep 21, 2026

    @rogerdigital
    Owner

    Confirmed and fixed in #92. Thanks for the detailed report — the reproduction was spot on.

    Root cause: the markdown converter used for EPUB chapters did not implement backslash escapes at all. An escaped asterisk \* was treated as a regular emphasis delimiter, so two of them in the same table row paired into an <em> that opened in one <td> and closed in another — invalid XHTML, which is why Books reported Opening and ending tag mismatch: em … and td. Outside tables, a lone \* had no pair and was printed with its backslash.

    What the fix covers (same root cause, same class of issues):

    • \* renders as a literal * everywhere — paragraphs, headings, list items, and table cells — with no spurious <em> and no leaked backslash
    • \| inside a table cell no longer splits the cell in two
    • \[text\](url) with escaped brackets renders as literal text instead of a link
    • Other escapes (\_, \\, \#, …) render as the literal character without the backslash
    • Unrelated but adjacent: bare multiplication like 3 * 4 * 5 is no longer italicized (CommonMark whitespace rules)
    • The Word (DOCX) export had the same emphasis-pairing and pipe-splitting behavior and is fixed in the same PR; PDF and HTML use Obsidian's native renderer by default and only hit the affected fallback when native rendering fails

    Escapes inside code blocks and inline code are untouched. The fix will ship in the next release; a build from the fix/markdown-backslash-escapes branch works immediately if you want to try it before then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions