in reply to Re: Re: Re: Re: Add line numbers to HTML
in thread Add line numbers to HTML

Going off on a wild ass guess here, it sounds like you have a bunch of "reports" embedded in to html. If thats the case, you could possibly embed the report inside a specific tag, like the perlmonks <code></code> tags. Then you only have to number content in side this tag and thats hugely simpler.

Of course you still have issues as to what exactly constitutes a line. If you do it based on new lines, you might not catch them all because thw browser will automatically wrap paragraphs in certain spots. From here you can basically implement you're own wrapping using text::wrap or something similar from cpan, or perhaps, maybe, do some strange stuff with javascript that might do what you want. But I doubt it.