Revision fdf75973
Von Moritz Bunkus vor etwa 8 Jahren hinzugefügt
SL/HelpSystem/MultiMarkdown.pm | ||
---|---|---|
25 | 25 |
my ($self, $file_name) = @_; |
26 | 26 |
|
27 | 27 |
my $markup = Encode::decode('utf-8', scalar(File::Slurp::slurp($file_name))); |
28 |
return $self->multimarkdown->markdown($markup); |
|
28 |
my $html = $self->multimarkdown->markdown($markup); |
|
29 |
$html = $self->_processh_intra_help_links($html); |
|
30 |
|
|
31 |
return $html; |
|
29 | 32 |
} |
30 | 33 |
|
34 |
sub _processh_intra_help_links { |
|
35 |
my ($self, $html) = @_; |
|
36 |
|
|
37 |
# <a href="help:_tests/lorem_ipsum"> |
|
38 |
|
|
39 |
$html =~ s{ |
|
40 |
( <a \s+ href \s* = \s* " ) help: |
|
41 |
}{ |
|
42 |
$1 . qq|controller.pl?action=Help/show&context=| |
|
43 |
}gxe; |
|
44 |
|
|
45 |
return $html; |
|
46 |
} |
|
47 |
|
|
48 |
|
|
31 | 49 |
1; |
Auch abrufbar als: Unified diff
Hilfesystem: einfache Intra-Hilfe-Links mit [Text](help:controller/action)