Exemple #1
0
 def _runRemoveScriptSlashesAnalyser(self):
     # ----------------------------------------------------------
     # Removes extra comment slashes (//) from <scrip> tags.
     # Eg:
     #  <script>
     #   //
     #   //
     #   var i = i +1
     #   //
     #   //
     #  </script>
     # This is a work around for TidyHtml which keeps inserting slashes at the start and end of 
     # the script tag resulting in a lot of repeating slashes.
     # -----------------------------------------------------------
     analyser = ZXhtmlScriptFindingAnalyser()
     self.analyse(analyser)
     for scriptOb in analyser.getScripts():
         text = getNoneString(scriptOb.element.getText())
         if text:
             text = getSafeString(REPEATING_SLASHES_RE.sub(u"\n", text)) #$NON-NLS-1$
             scriptOb.element.setText(text)
Exemple #2
0
 def _runRemoveScriptSlashesAnalyser(self):
     # ----------------------------------------------------------
     # Removes extra comment slashes (//) from <scrip> tags.
     # Eg:
     #  <script>
     #   //
     #   //
     #   var i = i +1
     #   //
     #   //
     #  </script>
     # This is a work around for TidyHtml which keeps inserting slashes at the start and end of
     # the script tag resulting in a lot of repeating slashes.
     # -----------------------------------------------------------
     analyser = ZXhtmlScriptFindingAnalyser()
     self.analyse(analyser)
     for scriptOb in analyser.getScripts():
         text = getNoneString(scriptOb.element.getText())
         if text:
             text = getSafeString(REPEATING_SLASHES_RE.sub(
                 u"\n", text))  #$NON-NLS-1$
             scriptOb.element.setText(text)
Exemple #3
0
 def getScripts(self):
     u"""getScripts() -> ZXhtmlScript[]"""  #$NON-NLS-1$
     analyser = ZXhtmlScriptFindingAnalyser()
     self.analyse(analyser)
     return analyser.getScripts()
Exemple #4
0
 def getScripts(self):
     u"""getScripts() -> ZXhtmlScript[]""" #$NON-NLS-1$
     analyser = ZXhtmlScriptFindingAnalyser()
     self.analyse(analyser)
     return analyser.getScripts()