Skip to content

Make the interpolation symbols configurable  #33

Open
@willatwork

Description

@willatwork

Style tags such as the following create errors in the generated javascript:

<style>.my-class { background: red; }</style>

Superviews tries to interpolate the stuff within the curly braces.

For my purposes, I've changed the interpolate function to

function interpolate (text) {
  text = text.replace(/\{%/g, '" + (')
  text = text.replace(/%\}/g, ') + "')
  text = text.replace(/\n/g, ' \\\n')
  return strify(text)
}

Which works great for me, but forces people to use {%variable%} instead of {variable}. Instead of introducing a breaking change, I suggest making the interpolation symbols configurable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions