And now with attachment :)

On Mon, Feb 15, 2016 at 10:44:57AM -0500, Jiri B wrote:
> A python wrapper against libtidy(p).
> 
> Maybe to useful to reconsider after ports unlock.
> 
> $ env LD_DEBUG=1 python2.7 -c "import tidylib" 2>&1 | grep tidy
> dlopen: loading: libtidyp.so
>  flags /usr/local/lib/libtidyp.so.0.0 = 0x0
> head /usr/local/lib/libtidyp.so.0.0
> obj /usr/local/lib/libtidyp.so.0.0 has /usr/local/lib/libtidyp.so.0.0 as head
> linking /usr/local/lib/libtidyp.so.0.0 as dlopen()ed
> head [/usr/local/lib/libtidyp.so.0.0]
> examining: '/usr/local/lib/libtidyp.so.0.0'
> tail /usr/local/lib/libtidyp.so.0.0
> doing ctors obj 0x1e8a91b3ac00 @0x1e8aa134c380: 
> [/usr/local/lib/libtidyp.so.0.0]
> dlopen: libtidyp.so: done (success).
> dlsym: tidyCreate in /usr/local/lib/libtidyp.so.0.0: 0x1e8aa1372360
> doing dtors obj 0x1e8a91b3ac00 @0x1e8aa1372570: 
> [/usr/local/lib/libtidyp.so.0.0]
> 
> And little test (from official doc):
> 
> $ python2.7 -c "from tidylib import tidy_document; doc, errors = 
> tidy_document('''<p>f&otilde;o <img src="bar.jpg">''', 
> options={'numeric-entities':1}); print(doc); print(errors)"
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
> <html>
>   <head>
>     <title></title>
>   </head>
>   <body>
>     <p>
>       f&#245;o <img src="bar.jpg" alt="">
>     </p>
>   </body>
> </html>
> 
> line 1 column 1 - Warning: missing <!DOCTYPE> declaration
> line 1 column 1 - Warning: inserting implicit <body>
> line 1 column 1 - Warning: inserting missing 'title' element
> line 1 column 15 - Warning: <img> lacks "alt" attribute
> 
> j.
> 

Attachment: pytidylib.tar.gz
Description: application/tar-gz



Reply via email to