[MKDoc-dev] Change to sub html in flo::editor::Text

Charlie Garrison garrison at zeta.org.au
Sat Sep 25 09:22:20 BST 2004


Good evening,

I was getting server errors when loading pages that contain text components.

parse_error: Is this XML well-formed? (could not find closing tag for "<html
xml:lang="en" dir="ltr" lang="en"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns="http://www.w3.org/1999/xhtml" i18n:domain="mkdoc">") at
/System/Library/Perl/5.8.1/CGI/Carp.pm line 314.

After a bit of digging I found the sub 'html' in flo::editor::Text
which wraps the formatted text in div elements:

    $data = "<div class=\"text\">$data</div>";

And then after formatting/substituting links, strips outer div elements:

    $res =~ s/^<div>//;
    $res =~ s/<\/div>$//;

The above code strips the trailing div, leaving unbalanced tags. The
obvious quick fix is to comment the two lines above. But why are those
div tags being stripped, do I need to look for a deeper problem? Should
the code be changed to something like:

    $res =~ s/^<div.*?>//;
    $res =~ s/<\/div>$//;

Or even:

    $res =~ s/^<div>//  and  
    $res =~ s/<\/div>$//;


Anyway, pages with text components are working fine now, with those
lines commented. Should I be stripping the divs instead?

Being new to this list, what is the best way to submit this as a
bug/fix?

Thanks,
Charlie

-- 
   Charlie Garrison  <garrison at zeta.org.au>
   PO Box 141, Windsor, NSW 2756, Australia


More information about the MKDoc-dev mailing list