Unable to manipluate string, read-only?
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 11.9k
- Forks
- 1.5k
- Avg merge
- 17h 55m
- Merged PRs (30d)
- 3
Description
So I have some data which is a string, I'm passing it into a section with the following method:
{%- liquid
assign myData = 'data],[data],[data'
capture header
section 'header'
endcapture
assign header = header | replace: '%%DATA%%', myData
-%}
Then within sections/header.liquid I have the following
{% capture replaced_data %}
%%DATA%%
{% endcapture %}
{%- liquid
assign data = replaced_data | split: '],['
echo data[0]
-%}
Now based off that, you'd expect the first data to be printed out, but infact the following is printed out
data],[data],[data
For some reason I'm no longer able to do any manipulation with this data once its in the sections/header.liquid file. I've even tried doing a replace on the ],[ but it just doesn't take effect. Any ideas on this?
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
Reproduce the behavior from the issue using the outer Liquid snippet and sections/header.liquid, focusing on the captured section output before the replace and split filters run. Compare the resulting value with the expected array element and determine whether section rendering preserves or changes the inserted string; done means the documented example behaves as expected or the limitation is clearly explained.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100