Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Štvrtok, 28. marec 2024

Súbor: [Platon] / iotta / Iotta / Format / In / TextPre.pm (stiahnutie)

Revízia 1.2, Sun Mar 23 11:29:58 2003 UTC (21 years ago) by yenar


Zmeny od 1.1: +6 -2 [lines]

use   on line beginnings and make output more readable [Iotta/Format/In/TextPre.pm]

package Iotta::Format::In::TextPre;
use base Iotta::Elem;
use strict;

sub run {
    my $s = shift;
    my $m = shift;
    my $in = shift;
    my $out;
    my $mark = "!\@CONVENIENCE LINEBREAK - bo <br>\@!";
    print "  parsing text format...\n";
    $in =~ s/&/&amp;/g;
    $in =~ s/</&lt;/g;
    $in =~ s/>/&gt;/g;
    $in =~ s/\n+$//;
    $in =~ s/^((?:&nbsp;)*) /$1&nbsp;/gsm;
    $in =~ s/\n\n+/<\/p>$mark<p>/gsm;
    $in =~ s/\n/<br\/>$mark/gsm;
    $in =~ s/$mark/\n/gsm;
    $out = "<iotta-ifmt><p>$in</p></iotta-ifmt>\n";
    $s->next->run ($m, $out) if ($s->next);
}

sub setup {
    my $self = shift;
    my $o = shift;
}

sub initialize {
    my $self = shift;
    $self->SUPER::initialize (@_);
}
1;

Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok