From ba30988580088acb7fae1359383f1f4261bdc42a Mon Sep 17 00:00:00 2001 From: mdipierro Date: Sat, 13 Jun 2020 23:06:38 -0700 Subject: [PATCH] fixed SCRIPT(ASSIGNJS(foo=bar)), thanks Paolo Pastori --- gluon/html.py | 6 ++++-- gluon/packages/dal | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gluon/html.py b/gluon/html.py index 6642cfc5..b4d597fd 100644 --- a/gluon/html.py +++ b/gluon/html.py @@ -1450,8 +1450,10 @@ class SCRIPT(DIV): (fa, co) = self._xml() fa = to_bytes(fa) # no escaping of subcomponents - co = b'\n'.join([to_bytes(component) for component in - self.components]) + co = b'\n'.join(map(to_bytes, + # allow xml components (i.e. ASSIGNJS) + map(lambda c: c.xml() if hasattr(c, 'xml') and callable(c.xml) else c, + self.components))) if co: #