Skip to content

Commit 05194cc

Browse files
committed
Doxygen supports <code>
Doxygen supports code so it looked like the view_seq_code was not required but the double quote has to be escaped. For the '<pre>' command the `-` sign at the beginning needs to be escaped otherwise it is seen as the start of a list (it doesn't hurt that the other `-` signs are escaped as well), so we need special handling of verbatim sections.
1 parent fb921c2 commit 05194cc

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/Doxygen/Filter/Perl/POD.pm

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,26 @@ sub view_head4
118118
}
119119

120120

121+
sub view_seq_code
122+
{
123+
my ($self, $text) = @_;
124+
$text =~ s/"/\\"/g;
125+
return "<code>$text</code>";
126+
}
127+
128+
129+
sub view_verbatim {
130+
my ($self, $text) = @_;
131+
for ($text) {
132+
s/&/&amp;/g;
133+
s/</&lt;/g;
134+
s/>/&gt;/g;
135+
s/-/\\-/g;
136+
}
137+
return "<pre>$text</pre>\n\n";
138+
}
139+
140+
121141
=head1 NAME
122142
123143
Doxygen::Filter::Perl::POD - A perl code pre-filter for Doxygen

0 commit comments

Comments
 (0)