fix: image alt texts on markdown posts are written into the markdown

POST /_journal/api/v1/images/alt writes the alt of a markdown post into
its source: the inline image ![alt](src) outside code
(classes.SetMarkdownImageAlt) or a raw img outside code
(classes.SetImageAltOutsideCode), so the next content save keeps it. An
image the markdown does not hold that way is refused with 422
changes.N.src and nothing is written.
This commit is contained in:
Jakub Zych
2026-11-04 23:20:02 +01:00
parent 5f683cba31
commit 7662d54ab3
6 changed files with 449 additions and 8 deletions

2
mcp.go
View File

@@ -229,7 +229,7 @@ func (p *Plugin) MCP() pact.MCP {
{
Name: "set_image_alt",
Title: "Set image alt texts",
Description: "Sets the alt text of images in post content, several at once; an empty alt marks an image as decorative.",
Description: "Sets the alt text of images in post content, several at once; an empty alt marks an image as decorative. In a markdown post the alt is written into the markdown source (an inline image ![alt](src), or a raw img tag outside code); an image the markdown does not hold that way (a reference-style image) is refused with changes.N.src: edit that post instead.",
Guard: mcpGuard,
Method: http.MethodPost,
Path: "/_journal/api/v1/images/alt",