lib/heartml/server_effects.rb in heartml-1.0.0.beta16 vs lib/heartml/server_effects.rb in heartml-1.0.0.beta17
- old
+ new
@@ -69,9 +69,14 @@
def _iso_effect_binding(attribute:, node:) # rubocop:disable Metrics
syntax = attribute.value
statements = syntax.split(";").map(&:strip)
statements.each do |statement| # rubocop:disable Metrics
+ if statement.start_with?(".")
+ # shortcut for text content
+ statement = "@textContent=#{statement}"
+ end
+
if statement.start_with?("@")
# property assignment
expression = statement.split("=").map(&:strip)
expression[0] = expression[0][1..]