Automattic / Automattic/juice

Unable to use FreeMarker template tags as juice.codeBlocks

Open
#257 4 comments 0 reactions 0 assignees View on GitHub
documentation
Dominant language
JavaScript
Stars
3.3k
Forks
233
Avg merge
1d 10h
Merged PRs (30d)
8

Description

**Issue**
I'm using FreeMarker templating tags inside an email template. However, when I try to exclude these using the `juice.codeBlocks` global, it still parses them.

```
juice.codeBlocks = {
start: '<#',
end: '>'
};

juice('<#list myObject.values as value>');
```

**Expected result**
`<#list myObject.values as value>`

**Actual result**
`<#list myObject.values="" as="" value="">`

**Example**
https://runkit.com/587926812ee9040013e6cc04/587926812ee9040013e6cc05

Contributor guide

Open the contributing guide

Research direction

Start with the linked Runkit reproduction and trace how juice.codeBlocks is handled when juice() processes the FreeMarker template tags. Confirm the fix by checking that the tags remain unchanged rather than being parsed into HTML attributes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.