Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Substringing HTML content

by fuzzysteve (Beadle)
on Jan 07, 2005 at 18:40 UTC ( [id://420336]=note: print w/replies, xml ) Need Help??


in reply to Substringing HTML content

While it's messy as hell, as an interim solution, write a subroutine that goes though it character by character which records the following things:

total characters so far
if you are in a tag (i.e. started with a <)
what the last character was
how many tags you are in
how many open tags there are (img could be problematic with this. ditto on any other atomic tags. xhtml would be easier)
what the open tags are and what order they are in

from that you should be able to run through the characters, taking note of all the tags that you'll need to close at the end.

not fun, and hopefully theres a better solution.

Replies are listed 'Best First'.
Re^2: Substringing HTML content
by eternius (Beadle) on Jan 07, 2005 at 20:41 UTC
    thanks :)
    ah crap, I got rid of the whole idea
    I now use a div width a fixed height and overflow:hidden.

    have a good day

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://420336]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-20 01:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found