[JSBeautifier] Fix error in jsbeautifier script
authorMiguel de Juana <miguel.dejuana@openbravo.com>
Tue, 07 Jun 2016 16:49:18 +0200
changeset 29616 c3e4d0384dc0
parent 29615 2a2a3a219bb0
child 29617 0b8997369760
[JSBeautifier] Fix error in jsbeautifier script

- Blank lines inside comment block makes the script fail.
modules/org.openbravo.client.kernel/jsbeautify/jsbeautifier.py
--- a/modules/org.openbravo.client.kernel/jsbeautify/jsbeautifier.py	Tue Jun 07 12:17:33 2016 +0200
+++ b/modules/org.openbravo.client.kernel/jsbeautify/jsbeautifier.py	Tue Jun 07 16:49:18 2016 +0200
@@ -987,7 +987,7 @@
 
         lines = token_text.replace('\x0d', '').split('\x0a')
         # all lines start with an asterisk? that's a proper box comment
-        if not any(l for l in lines[1:] if (l.lstrip())[0] != '*'):
+        if not any(l for l in lines[1:] if l.lstrip() and (l.lstrip())[0] != '*'):
             self.append_newline()
             self.append(lines[0])
             for line in lines[1:]: