Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use <erb> instead of <code> when parsing templates #105

Merged
merged 3 commits into from
Sep 4, 2013

Commits on Sep 3, 2013

  1. %s/code/erb/g

    This changes the ERB template parser to use `<erb>` rather than `<code>`
    to designate code blocks in a template.
    
    For example:
    
        <%= render template: 'foo/bar' %>
    
    Used to parse as:
    
        <code erb-loud> render template: 'foo/bar' </code>
    
    But not parses as:
    
        <erb erb-loud> render template: 'foo/bar' </erb>
    
    This fixes a number of problems that result from using `<code>`:
    
    * There may be </code> tags in the original ERB, which would be turned
      into `%>`
      (Fixes spree#101)
    
    * Any <code> tags in the <head> of a document would be moved to the
      body, since <code> is a real HTML tag, and isn't allowed in the head.
      This happens in nokogiri under jRuby or libXML 2.9.0
      (Fixes spree#84, Fixes spree#100)
    
    Unfortunately this breaks any existing deface selectors looking for
    code, which are somewhat common. Selectors should be updated to cover
    both code and erb:
    
        selector: "code:contains('my_method'), erb:contains('my_method')"
    jhawthorn committed Sep 3, 2013
    1 Configuration menu
    Copy the full SHA
    415422f View commit details
    Browse the repository at this point in the history
  2. test for head code tags

    jhawthorn committed Sep 3, 2013
    Configuration menu
    Copy the full SHA
    7463cc5 View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2013

  1. s/erb-(loud|silent)/\1/g

    As we're breaking existing selectors anyways, we might as well remove
    the redundant erb-.
    jhawthorn committed Sep 4, 2013
    Configuration menu
    Copy the full SHA
    328b0f2 View commit details
    Browse the repository at this point in the history