Skip to content

Commit 7ad8dc1

Browse files
johnnyoshikaclaude
andcommitted
Fix paragraph handler losing inline formatting (bold, italic, links)
MarkdownConverter correctly parses markdown into a rich AST, but _add_blocks_to_post was calling _extract_text_from_content() which re-serialized the AST back to a plain string — causing literal asterisks to appear in Substack instead of bold/italic text. Pass content directly to post.paragraph() since the Post class already supports rich content lists natively. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a26df08 commit 7ad8dc1

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/handlers/post_handler.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,9 +1287,8 @@ def _add_blocks_to_post(self, post: Post, blocks: List[Dict[str, Any]]):
12871287
content = block.get("content")
12881288

12891289
if block_type == "paragraph":
1290-
# Extract text and add as single paragraph
1291-
text_content = self._extract_text_from_content(content)
1292-
post.paragraph(text_content)
1290+
# Pass content list directly to preserve inline formatting (bold, italic, links)
1291+
post.paragraph(content)
12931292

12941293
elif block_type in [
12951294
"heading-one",

0 commit comments

Comments
 (0)