[Israel.pm] Editing an HTML fragment
shmuelfomberg at gmail.com
Sun Aug 26 07:16:24 PDT 2012
On Sun, Aug 26, 2012 at 8:57 PM, Natty wrote:
> probably will be an overkill, have u considered a templating engine???
> e.g Template::Toolkit? or even a simplier one
My situation is that I get a part of HTML, that contains unwanted part.
It is not HTML sanitizing, or composing.
I'm playing around in our product (Movable Type) with the concepts of
templates and plugins, and how to make them composable.
So I'm letting plugins write their data inside an entry text, (which is an
HTML part, will be included later inside a full HTML page) but this data
contains edit-time data and publish-time data. before the entry is ready to
be published, I need to throw the edit-time data, and leave only the
(the idea is that edit-time data and controls can be re-created later from
the publish-time data)
So I can't use a templating engine, as the html part is already complete. I
need to break it up, edit, and close again.
> On Aug 26, 2012 2:52 PM, "Shmuel Fomberg" wrote:
>> Hi all.
>> I have an part of HTML that I need to edit.
>> Currently, I'm wrapping it in
>> and the use HTML::TreeBuilder to parse, modify, and dump it back to text.
>> and then I remove the enclosing tags.
>> It works pretty well so far, but is there a better way?
>> Perl mailing list
>> Perl at perl.org.il
> Perl mailing list
> Perl at perl.org.il
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Perl