Skip to content
This repository was archived by the owner on Jun 10, 2018. It is now read-only.
This repository was archived by the owner on Jun 10, 2018. It is now read-only.

Fails when used with Rails and given an ActiveSupport::SafeBuffer #10

@moll

Description

@moll

This is a mirror of a bug on Sprockets as it affects either.

The problem is this: EjsTemplate passes data to EJS.compile which uses gsub! in its implementation. When used with Rails, data is an ActiveSupport::SafeBuffer whose gsub! is messed up at the moment and breaks $1, so the EJS compiling fails.

Should EjsTemplate force data to be a regular string with to_str or should that be EJS's job to make sure the input is a regular string?

I've made a committed fix on ruby-ejs' end for now quick use. If that's the best place to convert SafeBuffers to strings, I can just make a pull request or you can pick a cherry.

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