Adds data-attribute for binding to control escaping.
authordsc <dsc@wikimedia.org>
Mon, 7 May 2012 14:14:00 +0000 (07:14 -0700)
committerdsc <dsc@wikimedia.org>
Mon, 7 May 2012 14:14:00 +0000 (07:14 -0700)
lib/base/data-binding.co

index a70103b..3ec4899 100644 (file)
@@ -48,7 +48,10 @@ class exports.DataBinding
             else if bp.is 'input, textarea'
                 bp.val @serialize val
             else
-                bp.text @serialize val
+                if op.toBool bp.data 'data-bind-escape'
+                    bp.text @serialize val
+                else
+                    bp.html @serialize val
         else
             false and console.warn "#this.updateBinding(): Unable to find data bind-point for #key=#val!"
         this