File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
main/java/org/commonmark/renderer/html
test/java/org/commonmark/test Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
66This project adheres to [ Semantic Versioning] ( http://semver.org/spec/v2.0.0.html ) ,
77with the exception that 0.x versions can break between minor versions.
88
9+ ## Unreleased
10+ ### Fixed
11+
12+ - Fix rendering of image alt text to include contents of code spans (`` `code` `` ). (#398 )
13+
914## [ 0.25.1] - 2025-08-01
1015### Fixed
1116- footnotes: Fix parsing of footnote definitions containing multiple paragraphs
Original file line number Diff line number Diff line change @@ -311,6 +311,11 @@ public void visit(Text text) {
311311 sb .append (text .getLiteral ());
312312 }
313313
314+ @ Override
315+ public void visit (Code code ) {
316+ sb .append (code .getLiteral ());
317+ }
318+
314319 @ Override
315320 public void visit (SoftLineBreak softLineBreak ) {
316321 sb .append ('\n' );
Original file line number Diff line number Diff line change @@ -279,6 +279,16 @@ public void imageAltTextWithEntities() {
279279 assertThat (defaultRenderer ().render (parse ("\n " ))).isEqualTo ("<p><img src=\" /url\" alt=\" foo \u00E4 \" /></p>\n " );
280280 }
281281
282+ @ Test
283+ public void imageAltTextWithInlines () {
284+ assertThat (defaultRenderer ().render (parse ("](/url)\n " ))).isEqualTo ("<p><img src=\" /url\" alt=\" foo bar link\" /></p>\n " );
285+ }
286+
287+ @ Test
288+ public void imageAltTextWithCode () {
289+ assertThat (defaultRenderer ().render (parse ("\n " ))).isEqualTo ("<p><img src=\" /url\" alt=\" foo bar\" /></p>\n " );
290+ }
291+
282292 @ Test
283293 public void canRenderContentsOfSingleParagraph () {
284294 Node paragraphs = parse ("Here I have a test [link](http://www.google.com)" );
You can’t perform that action at this time.
0 commit comments