Skip to content

Commit f9499c8

Browse files
authored
Merge pull request #15 from albert-github/feature/bug_head_nl
Remove `\n` from headers
2 parents 19939ea + 1f2fd75 commit f9499c8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lib/Doxygen/Filter/Perl/POD.pm

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,18 @@ sub convertText
6363
$label =~ s/@/_0D/g;
6464
$label =~ s/-/_0E/g;
6565
$label =~ s/[^a-z0-9A-Z]/_/g;
66-
print("New $label\n");
6766

6867
$label = "x$label"; # label should not start with a underscore
68+
return $label;
6969
}
70+
71+
sub convertTitle
72+
{
73+
my $title = shift;
74+
$title =~ s/\n/ /g;
75+
return $title;
76+
}
77+
7078
sub setAsLabel
7179
{
7280
# based on e.g. a file name try to create a doxygen label prefix
@@ -86,6 +94,7 @@ sub view_head1
8694
my ($self, $head1) = @_;
8795
my $title = $head1->title->present($self);
8896
my $name = convertText($title);
97+
$title = convertTitle($title);
8998
$labelCnt += 1;
9099
return "\n\@section $sectionLabel$name$labelCnt $title\n" . $head1->content->present($self);
91100
}
@@ -95,6 +104,7 @@ sub view_head2
95104
my ($self, $head2) = @_;
96105
my $title = $head2->title->present($self);
97106
my $name = convertText($title);
107+
$title = convertTitle($title);
98108
$labelCnt += 1;
99109
return "\n\@subsection $sectionLabel$name$labelCnt $title\n" . $head2->content->present($self);
100110
}
@@ -104,6 +114,7 @@ sub view_head3
104114
my ($self, $head3) = @_;
105115
my $title = $head3->title->present($self);
106116
my $name = convertText($title);
117+
$title = convertTitle($title);
107118
$labelCnt += 1;
108119
return "\n\@subsubsection $sectionLabel$name$labelCnt $title\n" . $head3->content->present($self);
109120
}
@@ -113,6 +124,7 @@ sub view_head4
113124
my ($self, $head4) = @_;
114125
my $title = $head4->title->present($self);
115126
my $name = convertText($title);
127+
$title = convertTitle($title);
116128
$labelCnt += 1;
117129
return "\n\@paragraph $sectionLabel$name$labelCnt $title\n" . $head4->content->present($self);
118130
}

0 commit comments

Comments
 (0)