Skip to content

Conversation

@stellarpower
Copy link

Add boolean parameter to mustache to control whether escaping of special characters is performed or not.

I am working with plain files, YAML, etc., and the HTML escaping that the Mustache_Engine is set up with causes problems here.

It might be desirable to expose further finetuning instead of making it a boolean, leave that up to you.

I've done basic tests but not written any testcases etc.

* `mustache(String template, [Table variables]={}): String`
*
* Renders a [mustache](https://mustache.github.io) template.
* Returns the resulting string.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not necessary to update the docs/ markdown files, can you instead add the changes to this doc comment, I use these to generate the markdown files on each release.

### mustache

`mustache(String template, [Table variables]={}): String`
`mustache(String template, [Table variables]={}, [Bool escape]=true): String`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value is actually false

Also see other change request; you should leave this file unchanged and just make the docs changes directly in the class file comment.

Copy link
Author

@stellarpower stellarpower Oct 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yep, I think copilot did that and I uncommitted and recommitted. Maybe my force push didn't go through, I hate git. But it should default to true to preserve existing behaviour. Anyway, only added a couple of lines so feel free to add it in your master branch however you want if it's something you'd like to add :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants