Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5b414a78

Von Moritz Bunkus vor etwa 8 Jahren hinzugefügt

  • ID 5b414a783834893ccb248ad78dd81f47c3bb03ec
  • Vorgänger 9dd81527
  • Nachfolger fdf75973

MultiMarkdown: hervorgehobene Blöcke durch Einbettung in … implementiert

Unterschiede anzeigen:

modules/override/Text/MultiMarkdown.pm
320 320
    return $text;
321 321
}
322 322

  
323
sub _DoAttentionBlocks {
324
    my ($self, $text) = @_;
325

  
326
    $text =~ s{
327
        (?:\n\n+|\A)
328
        ==
329
        ( .*? )
330
        ==
331
        (?:\n+|\Z)
332
    }{
333
        my $result = qq|\n\n<div class="attention">|;
334
        $result   .= $self->_RunBlockGamut($1, { wrap_in_p_tags => 1 });
335
        $result   .= qq|</div>\n\n|;
336

  
337
        $result;
338
    }egmsx;
339

  
340
    return $text;
341
}
342

  
323 343
sub _Markdown {
324 344
#
325 345
# Main function. The order in which other subs are called here is
......
343 363
    # MMD only
344 364
    $text = $self->_StripMarkdownReferences($text);
345 365
    $text = $self->_DoCodeBlocksMultiBackticks($text);
366
    $text = $self->_DoAttentionBlocks($text);
346 367

  
347 368
    $text = $self->_RunBlockGamut($text, {wrap_in_p_tags => 1});
348 369

  

Auch abrufbar als: Unified diff