Hi Sandro, Martin,

Sorry for not replying sooner, I am just drowning in work currently.

I have looked at the pisa package and tried to patch it the way I
mentionned earlier, but it turned out to not be sufficient, so I have
made some more modifications. You can find a first (somewhat dirty)
draft of patch in attachment.

With this patch, xhtml2pdf seemed to work correctly on several test
pages (e.g. this one[0]).

I'll try to improve/test this patch further. I'd not upload it in its
current state.

Could anybody have a look at it ?

Getting rid of pisa for buster would be a good idea indeed.

Thanks !

Cheers,
 Hugo

[0] http://noir.liw.fi/

-- 
             Hugo Lefeuvre (hle)    |    www.owl.eu.com
4096/ ACB7 B67F 197F 9B32 1533 431C AC90 AC3E C524 065E
--- a/sx/pisa3/pisa_parser.py	2017-02-08 15:38:26.127678118 +0100
+++ b/sx/pisa3/pisa_parser.py	2017-02-08 15:38:49.755588784 +0100
@@ -26,7 +26,8 @@
 import os.path
 
 import html5lib
-from html5lib import treebuilders, serializer, treewalkers, inputstream
+from html5lib import treebuilders, treewalkers
+from html5lib import _inputstream as inputstream
 from xml.dom import Node
 import xml.dom.minidom
 
@@ -611,9 +612,7 @@
              if inputstream.codecName(encoding) is None:
                  log.error("%r is not a valid encoding", encoding)
     
-    document = parser.parse(
-        src,
-        encoding=encoding)
+    document = parser.parse(src)
         
     if xml_output:        
         xml_output.write(document.toprettyxml(encoding="utf8"))    
--- a/sx/pisa3/pisa_context.py	2017-02-08 15:38:26.127678118 +0100
+++ b/sx/pisa3/pisa_context.py	2017-02-08 15:38:26.123678133 +0100
@@ -40,8 +40,6 @@
 
 from sx.w3c import css, cssDOMElementInterface
 
-from html5lib.sanitizer import *
-
 import logging
 log = logging.getLogger("ho.pisa")
 

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

Reply via email to