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)
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)
def getScripts(self): u"""getScripts() -> ZXhtmlScript[]""" #$NON-NLS-1$ analyser = ZXhtmlScriptFindingAnalyser() self.analyse(analyser) return analyser.getScripts()