@@ -19,6 +19,7 @@ with VSS.IRIs;
1919with VSS.XML.Events ;
2020with VSS.XML.Namespaces ;
2121
22+ with Markdown.Attribute_Lists ;
2223with Markdown.Inlines.Visitors ;
2324with Markdown.Block_Containers ;
2425with Markdown.Blocks.Indented_Code ;
@@ -41,6 +42,9 @@ package body GNATdoc.Backend.HTML_Markup is
4142 (Self : in out Annotated_Text_Builder;
4243 Text : VSS.Strings.Virtual_String);
4344
45+ overriding procedure Visit_Soft_Line_Break
46+ (Self : in out Annotated_Text_Builder) is null ;
47+
4448 overriding procedure Enter_Emphasis
4549 (Self : in out Annotated_Text_Builder);
4650
@@ -62,12 +66,14 @@ package body GNATdoc.Backend.HTML_Markup is
6266 overriding procedure Enter_Image
6367 (Self : in out Annotated_Text_Builder;
6468 Destination : VSS.Strings.Virtual_String;
65- Title : VSS.Strings.Virtual_String);
69+ Title : VSS.Strings.Virtual_String;
70+ Attributes : Markdown.Attribute_Lists.Attribute_List);
6671
6772 overriding procedure Leave_Image
6873 (Self : in out Annotated_Text_Builder;
6974 Destination : VSS.Strings.Virtual_String;
70- Title : VSS.Strings.Virtual_String);
75+ Title : VSS.Strings.Virtual_String;
76+ Attributes : Markdown.Attribute_Lists.Attribute_List);
7177
7278 procedure Build_Annotated_Text
7379 (Result : in out VSS.XML.Event_Vectors.Vector;
@@ -229,7 +235,6 @@ package body GNATdoc.Backend.HTML_Markup is
229235
230236 begin
231237 Markdown.Parsers.GNATdoc_Enable (Parser);
232- Parser.Set_Extensions ((Link_Attributes => True));
233238
234239 for Line of Text loop
235240 Parser.Parse_Line (Line);
@@ -294,7 +299,8 @@ package body GNATdoc.Backend.HTML_Markup is
294299 overriding procedure Enter_Image
295300 (Self : in out Annotated_Text_Builder;
296301 Destination : VSS.Strings.Virtual_String;
297- Title : VSS.Strings.Virtual_String) is
302+ Title : VSS.Strings.Virtual_String;
303+ Attributes : Markdown.Attribute_Lists.Attribute_List) is
298304 begin
299305 Self.Image := True;
300306 end Enter_Image ;
@@ -338,7 +344,8 @@ package body GNATdoc.Backend.HTML_Markup is
338344 overriding procedure Leave_Image
339345 (Self : in out Annotated_Text_Builder;
340346 Destination : VSS.Strings.Virtual_String;
341- Title : VSS.Strings.Virtual_String)
347+ Title : VSS.Strings.Virtual_String;
348+ Attributes : Markdown.Attribute_Lists.Attribute_List)
342349 is
343350 use type VSS.Strings.Virtual_String;
344351
@@ -354,6 +361,15 @@ package body GNATdoc.Backend.HTML_Markup is
354361 Write_Attribute (Self.Stream, " alt" , Self.Text);
355362 end if ;
356363
364+ for J in 1 .. Attributes.Length loop
365+ if Attributes.Name (J) = " width" then
366+ Write_Attribute (Self.Stream, " width" , Attributes.Value (J));
367+
368+ elsif Attributes.Name (J) = " height" then
369+ Write_Attribute (Self.Stream, " height" , Attributes.Value (J));
370+ end if ;
371+ end loop ;
372+
357373 Write_End_Element (Self.Stream, " img" );
358374
359375 Self.Image := False;
0 commit comments