Is it possible to get the raw markup from a liquid block?
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 11.9k
- Forks
- 1.5k
- Avg merge
- 17h 55m
- Merged PRs (30d)
- 3
Description
Situation
I am in an unusual situation in that i am wanting to use liquid to wrap my markup in a html element and keep the raw markup inside; including the {{ and }}'s, the reason being i am allowing merchants to create their own templates for listings to be dynamically rendered back from the server, so they can define their template once, then all listings returned back will use that template.
I would like for this functionality be abstracted away so that they can just wrap their template in a liquid block, then that liquid block will be turned into a html wrapper i can the read and send to my server with js.
However when i create a new Liquid::Block class it seems i can only call super to get the parsed version of the markup within, is there anyway i can get the raw liquid inside the block?
My block has the name listing and i have noticed i can call it like this
{% listing %}
{% raw %}
{{ foo.bar }}
{% endraw %}
{% endlisting %}
to read the raw content within, however this is not ideal, i would much prefer if my listing block class, could just read the raw markup itself, is this possible?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing Liquid::Block and the custom listing block described in the issue, then compare their behavior with the {% raw %} workaround. Determine whether unparsed block content is exposed and identify the relevant tests or documentation needed to establish the supported behavior.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100