fix: drop alt text from Jira wiki image markup - #6
Merged
Merged
Conversation
ToJiraMD rendered `` as `!urlalt!`, concatenating the destination and alt text inside the same `!...!` markers because the vendored blackfriday-confluence renderer writes the opening/closing markers but still lets the Image node's children (the alt text) fall through to default text rendering in between. Jira wiki image syntax has no slot for alt text, so we now walk the AST ourselves, write the `!url!` markers directly for Image nodes, and skip their children while delegating every other node to the existing renderer.
Writing the image markers straight to the buffer bypassed the renderer, whose internal state decides whether the next block needs a leading newline. That left it stale, so a table or list following an image was glued onto the preceding line and did not render in Jira.
rethab
added a commit
that referenced
this pull request
Aug 5, 2026
ToJiraMD currently renders \`\` as \`!https://google.comdescription!\`, which is invalid Jira wiki image syntax. The vendored blackfriday-confluence renderer writes the opening and closing \`!\` markers for an image node but never suppresses the node's children, so the alt text gets written into the default text stream between the two markers. Jira wiki image markup (\`!url!\`) has no place for alt text at all, so the fix walks the markdown AST directly in \`pkg/md/md.go\` instead of calling \`renderer.Render\` as-is: for image nodes it writes \`!\` + destination + \`!\` and returns \`bf.SkipChildren\` to drop the alt text subtree, delegating every other node type to the existing \`renderer.RenderNode\`. The existing no-alt-text image case (\`\` -> \`!url!\`) is unaffected, and a new case for \`\` was added to the test to lock in the fix. Addresses ankitpokhrel#568.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ToJiraMD currently renders `
` as `!https://google.comdescription!\`, which is invalid Jira wiki image syntax. The vendored blackfriday-confluence renderer writes the opening and closing `!` markers for an image node but never suppresses the node's children, so the alt text gets written into the default text stream between the two markers.
Jira wiki image markup (`!url!`) has no place for alt text at all, so the fix walks the markdown AST directly in `pkg/md/md.go` instead of calling `renderer.Render` as-is: for image nodes it writes `!` + destination + `!` and returns `bf.SkipChildren` to drop the alt text subtree, delegating every other node type to the existing `renderer.RenderNode`. The existing no-alt-text image case (`
` -> `!url!`) is unaffected, and a new case for `
` was added to the test to lock in the fix.
Addresses ankitpokhrel#568.