Re: "Downgrading" HTML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2010-09-16 at 14:07 -0400, Matt Neimeyer wrote:

> I know I could possibly hack something together using the Tidy
> libraries... (maybe...) but are there any existing php libraries /
> projects that already have the ability to take some HTML and
> "downgrade" the version of HTML being used.
> 
> One example: turn this...
> 
>    <p style="font-weight: bold">Blah</p>
> 
> ... into ...
> 
>    <p><b>Blah</b></p>
> 
> This is for an eReader I love but is long out of production and the
> converter tool only works with HTML 3.2
> 
> Thanks in advance.
> 
> Matt
> 


You'd need a full on HTML parser, as what about an element that is given
a bold font from an included stylesheet? Where would you put the bold
tag then? Regular expressions really won't cut this either. Maybe it's
time to look for a different reader?

Thanks,
Ash
http://www.ashleysheridan.co.uk



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux