Shopify / Shopify/liquid

Rendering doesn't work with URL filters

Open
#1,201 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
11.9k
Forks
1.5k
Avg merge
17h 55m
Merged PRs (30d)
3

Description

I'm trying to use the link_to filter.

This is what I'm doing

body = "Click {{ 'HERE' | link_to: link, 'A link to google' }}"
liquid_template = Liquid::Template.parse(body).render('link' => 'www.google.com')

This is what I'm expecting as the output

Click <a href="www.google.com" title="A link to google">HERE</a>

However, I'm getting this

Click HERE

What am I doing wrong?

If it helps I'm on Liquid 4.0.3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the example with Liquid::Template.parse, the link_to filter, and Liquid 4.0.3. Compare the rendered result with the expected anchor output and determine whether the issue is in the example or in link_to rendering; done means the cause and required behavior are established.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.