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
}
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) {