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

Handle ERB blocks within HTML #1

Open
romaricpascal opened this issue Sep 1, 2021 · 0 comments
Open

Handle ERB blocks within HTML #1

romaricpascal opened this issue Sep 1, 2021 · 0 comments

Comments

@romaricpascal
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant