Epoz __init__.py,1.36,1.37 CHANGES.txt,1.98,1.99

Maik Jablonski <[email protected]>
Newsgroups gmane.comp.web.zope.epoz
Message-ID <[email protected]>
Update of /cvsroot/epoz/Epoz
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20497

Modified Files:
	__init__.py CHANGES.txt 
Log Message:
fixes for JavaScript-in-content-area-fixes

Index: CHANGES.txt
===================================================================
RCS file: /cvsroot/epoz/Epoz/CHANGES.txt,v
retrieving revision 1.98
retrieving revision 1.99
diff -C2 -d -r1.98 -r1.99
*** CHANGES.txt	19 Feb 2005 13:46:33 -0000	1.98
--- CHANGES.txt	19 Feb 2005 13:59:52 -0000	1.99
***************
*** 3,6 ****
--- 3,10 ----
   0.9.1 (in progress)
  
+      - some fixes for "JavaScript in content-area-fixes" (upper-case tags,
+        missing whitespace after script-tag, etc.pp); Thanks to
+        Johannes Gijsbers!
+ 
       - added slovak translation for Epoz; Thanks to Rastislav "Rasto" Mucha!
  

Index: __init__.py
===================================================================
RCS file: /cvsroot/epoz/Epoz/__init__.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** __init__.py	19 Feb 2005 13:46:33 -0000	1.36
--- __init__.py	19 Feb 2005 13:59:52 -0000	1.37
***************
*** 38,42 ****
  HTML_BODY = re.compile('<body[^>]*?>(.*)</body[^>]*?>', re.DOTALL|re.IGNORECASE)
  MSO_CLASS = re.compile(r'<(\w+)\W+(class="Mso.*?")>', re.IGNORECASE)
! EPOZ_SCRIPT = re.compile(r'<epoz:script (style="[^"]*")? ?')
  
  misc_ = {
--- 38,42 ----
  HTML_BODY = re.compile('<body[^>]*?>(.*)</body[^>]*?>', re.DOTALL|re.IGNORECASE)
  MSO_CLASS = re.compile(r'<(\w+)\W+(class="Mso.*?")>', re.IGNORECASE)
! EPOZ_SCRIPT = re.compile(r'<epoz:script( style="[^"]*")?')
  
  misc_ = {
***************
*** 138,144 ****
  
      # hide scripts without removing them
!     js_data = js_data.replace('<script ',
!                                     '<epoz:script style="display: none" ')
      js_data = js_data.replace('</script>', '</epoz:script>')
  
      # Quote newlines and single quotes, so the Epoz-JavaScript won't break.
--- 138,145 ----
  
      # hide scripts without removing them
!     js_data = js_data.replace('<script', '<epoz:script style="display: none;"')
      js_data = js_data.replace('</script>', '</epoz:script>')
+     js_data = js_data.replace('<SCRIPT', '<epoz:script style="display: none;"')
+     js_data = js_data.replace('</SCRIPT>', '</epoz:script>')
  
      # Quote newlines and single quotes, so the Epoz-JavaScript won't break.
***************
*** 204,208 ****
          call EpozPostTidy for html-postprocessings before returning the result
      """
- 
      errors = 0
      output = html
--- 205,208 ----
***************
*** 210,214 ****
  
      input = html.encode("utf-8")
!     input = EPOZ_SCRIPT.sub('<script ', input)
      input = input.replace('</epoz:script>', '</script>')
  
--- 210,214 ----
  
      input = html.encode("utf-8")
!     input = EPOZ_SCRIPT.sub('<script', input)
      input = input.replace('</epoz:script>', '</script>')
  



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.