Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

[TEM #1] - Escape Arguments In Template Files #1

Closed
sgoudham opened this issue Apr 30, 2022 · 0 comments · Fixed by #3
Closed

[TEM #1] - Escape Arguments In Template Files #1

sgoudham opened this issue Apr 30, 2022 · 0 comments · Fixed by #3
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@sgoudham
Copy link
Owner

What's the Issue?

At the minute, arguments within template files are not subject to escaping. This ultimately hurts the user as the user may genuinely want to include {path} within their template file and not have it replaced by an argument.

Current Behaviour

Given template file foo.md

Article written by \\{author}

and article bar.md

{{#template foo.md author=bar}}

When the above example is compiled, the resulting bar.md looks like

Article written by \\bar

Expected Behaviour

Given template file foo.md

Article written by \\{author}

and article bar.md

{{#template foo.md author=bar}}

When the above example is compiled, the resulting bar.md should look like

Article written by {author}

Proposed Changes

Unfortunately, I'm not sure how to implement this behaviour without completely replacing the current replace_all() method from the AhoCorasick crate with another regex that is similar to the way {{#template ...}} is implemented.

@sgoudham sgoudham added enhancement New feature or request good first issue Good for newcomers labels Apr 30, 2022
@sgoudham sgoudham added this to the v0.2.0 milestone Apr 30, 2022
@sgoudham sgoudham changed the title [v0.2.0] - Escape Arguments In Template Files [TEM #1] - Escape Arguments In Template Files May 1, 2022
sgoudham added a commit that referenced this issue May 2, 2022
sgoudham added a commit that referenced this issue May 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant