You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While implementing this, be sure to use eval('(expression)') to limit the potential for arbitrary code execution. Wrapping eval statements in parenthesis should limit the execution merely to evaluating conditionals to some degree.
A related thing to consider is adding <script eval> to let Teddy just execute scripts. If you need to do that, it probably means you're coding a template in a badly designed app, so I would rather encourage the developer to refactor things than give Teddy a way to sidestep technical debt. However it might possibly be worth implementing it as an off by default feature that has to be turned on with settings perhaps.
HTML grammar doesn't permit things like:
This is because
location
is an attribute that is being duplicated on the same element multiple times.To achieve this style of boolean logic, we need a new syntax that can evaluate JavaScript expressions directly:
Same for one-line ifs:
Implementing this would also allow us to close:
While implementing this, be sure to use
eval('(expression)')
to limit the potential for arbitrary code execution. Wrapping eval statements in parenthesis should limit the execution merely to evaluating conditionals to some degree.A related thing to consider is adding
<script eval>
to let Teddy just execute scripts. If you need to do that, it probably means you're coding a template in a badly designed app, so I would rather encourage the developer to refactor things than give Teddy a way to sidestep technical debt. However it might possibly be worth implementing it as an off by default feature that has to be turned on with settings perhaps.See also https://macarthur.me/posts/with
The text was updated successfully, but these errors were encountered: