Skip to content

Matching the entire file in :surround #245

@borisbrodski

Description

@borisbrodski

Thanks for the great project! This is a feature request or a question.

I would like to match the entire file, e.g.

<p>...</p>
<p>...</p>
<p>...</p>

to surround it with if condition. I tried to use * matcher:

        Deface::Override.new(
          virtual_path: 'projects/new',
          name: 'projects--hide-on-condition',
          surround: "*",
          text: <<-ERB
          (((
            <%= render_original %>
          )))
          ERB
        )

but it gets 3 matches producing output like

(((
<p>...</p>
)))
(((
<p>...</p>
)))
(((
<p>...</p>
)))

and NOT

(((
<p>...</p>
<p>...</p>
<p>...</p>
)))

as expected.

How to match the entire content of an '.html.erb' file?

Thank you in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions