]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gtkdoc: Fix generated markup for source code blocks
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Wed, 13 May 2015 16:47:04 +0000 (18:47 +0200)
committerFlorian Brosch <flo.brosch@gmail.com>
Sun, 10 Jan 2016 20:55:25 +0000 (21:55 +0100)
Just emitting <programlisting> doesn’t work, as gtk-doc will insert <para> tags in the middle of the code block, generating invalid markup.

Instead of trying to reinvent how gtk-doc does things, just emit the gtk-doc shorthand markup for a code block and let gtk-doc generate the markup.

https://bugzilla.gnome.org/show_bug.cgi?id=725194

src/doclets/gtkdoc/commentconverter.vala

index 6950a1afb82e90e44aa4ef4f49e2ae0ddb962e22..450e751bafdb2138868991d8a482cebbcaf90f37 100644 (file)
@@ -228,9 +228,9 @@ public class Gtkdoc.CommentConverter : ContentVisitor {
        }
   
        public override void visit_source_code (SourceCode code) {
-               current_builder.append ("<programlisting>");
+               current_builder.append ("\n|[\n");
                current_builder.append (Markup.escape_text (code.code));
-               current_builder.append ("</programlisting>");
+               current_builder.append ("\n]|\n");
        }
   
        public override void visit_table (Table t) {