Skip to content

Handle ERB blocks within HTML #1

@romaricpascal

Description

@romaricpascal

Current parser extension, based on the sample in Kramdown's documentation, ignores ERB when it's nested inside HTML tags. For example:

<<%= "div" %>></<%= "div">>
<div <%= "attribute='value'" %>></div>
<div >
  <%= "Erb test" %>
</div>

This can always be circumvented by using <%= tag.ELEMENT do %>, but could use sorting out. Only 3rd example feels actively useful, though (as for the other 2 tag.ELEMENT would provide a clearer code, I think).

Plan would likely be to override add_text to do some further scanning when adding a text node to try and detect one or several ERB tags, in a similar way that Kramdown's parse_raw_html does for HTML tags.

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