Skip to content

Commit eac95c4

Browse files
authored
Merge pull request #5 from johnnyoshika/fix/captioned-image-block
Fix captioned-image block rendering as literal markdown text
2 parents a26df08 + c768eb2 commit eac95c4

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

src/handlers/post_handler.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,18 +1321,9 @@ def _add_blocks_to_post(self, post: Post, blocks: List[Dict[str, Any]]):
13211321
post.add({"type": "paywall"})
13221322

13231323
elif block_type == "captioned-image":
1324-
# Convert to paragraph with markdown - this is the only reliable way
13251324
image_src = block.get("src", "")
13261325
image_alt = block.get("alt", "")
1327-
image_caption = block.get("caption", "")
1328-
1329-
# Create markdown image syntax
1330-
image_markdown = f"![{image_alt}]({image_src})"
1331-
if image_caption:
1332-
image_markdown += f"\n\n*{image_caption}*"
1333-
1334-
# Add as a regular paragraph
1335-
post.paragraph(image_markdown)
1326+
post.add({"type": "captionedImage", "src": image_src, "alt": image_alt})
13361327

13371328
elif block_type == "code":
13381329
# Code blocks - add as proper code_block type

0 commit comments

Comments
 (0)