JS template strings https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings … are shipping in Firefox 34 in two weeks. Can't wait for other browsers to add support too.
@elwoz @theunfocused Also, html_escape`a${b}c${d}` which escapes the replacements is better than "a" + html_escape(b) + "c" + html_escape(d)
-
-
@bz_moz@theunfocused ... all subexpressions are shifted to trailing arguments, but it's equivalently expressive. -
@elwoz@theunfocused But much harder to read. But yes, I sympathize with the concern...
End of conversation
New conversation -
-
-
@bz_moz@theunfocused My primary concern is, honestly, with adding a new form of quotation at all. Existing sanitizers will not understand. -
@elwoz@bz_moz@theunfocused Existing sanitizers that aren't whitelist-based, and rejecting unrecognized syntax, are Doing It Wrong. - 1 more reply
New conversation -
-
-
@bz_moz@theunfocused Having expressions nested inside strings means that the tokenizer has to recurse into the parser, which is always bad. -
@elwoz@bz_moz@theunfocused No different from any other AST recursion, really. Parentheses do the same thing. - 2 more replies
New conversation -
-
-
@bz_moz@theunfocused (Otherwise, if someone writes `before ${a + `bcd` + b} after`, it blows up.)Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@bz_moz@theunfocused I'd have preferred something along the lines of Python's .format() method. No new quotation introduced, and ...Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@bz_moz@theunfocused hypothetically: "a{b}c{d}".format(_escape=html, b=b, d=d)Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.