Fix extended-text/heading/quote nodes: treat as inline text when inside links

Ghost's extended-text node can appear both as a block (with children) and
inline (with text field). When used as a child of a link node, it has a
text field and should produce a text literal, not a (p ...) wrapper.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 23:47:54 +00:00
parent 588d240ddc
commit a8e06e87fb

View File

@@ -138,6 +138,10 @@ def _paragraph(node: dict) -> str:
@_converter("extended-text")
def _extended_text(node: dict) -> str:
# extended-text can be block-level (with children) or inline (with text).
# When it has a "text" field, treat it as a plain text node.
if "text" in node:
return _text(node)
return _paragraph(node)
@@ -152,6 +156,8 @@ def _heading(node: dict) -> str:
@_converter("extended-heading")
def _extended_heading(node: dict) -> str:
if "text" in node:
return _text(node)
return _heading(node)
@@ -163,6 +169,8 @@ def _quote(node: dict) -> str:
@_converter("extended-quote")
def _extended_quote(node: dict) -> str:
if "text" in node:
return _text(node)
return _quote(node)