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/).
6
6
This project adheres to [ Semantic Versioning] ( http://semver.org/spec/v2.0.0.html ) ,
7
7
with the exception that 0.x versions can break between minor versions.
8
8
9
+ ## Unreleased
10
+ ### Fixed
11
+
12
+ - Fix rendering of image alt text to include contents of code spans (`` `code` `` ). (#398 )
13
+
9
14
## [ 0.25.1] - 2025-08-01
10
15
### Fixed
11
16
- 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) {
311
311
sb .append (text .getLiteral ());
312
312
}
313
313
314
+ @ Override
315
+ public void visit (Code code ) {
316
+ sb .append (code .getLiteral ());
317
+ }
318
+
314
319
@ Override
315
320
public void visit (SoftLineBreak softLineBreak ) {
316
321
sb .append ('\n' );
Original file line number Diff line number Diff line change @@ -279,6 +279,16 @@ public void imageAltTextWithEntities() {
279
279
assertThat (defaultRenderer ().render (parse ("\n " ))).isEqualTo ("<p><img src=\" /url\" alt=\" foo \u00E4 \" /></p>\n " );
280
280
}
281
281
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
+
282
292
@ Test
283
293
public void canRenderContentsOfSingleParagraph () {
284
294
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