Skip to content

Add autoEscape option, |safe filter and |e,|htmlEscape filters#114

Open
iffy wants to merge 4 commits into
enthus1ast:masterfrom
iffy:autoescape
Open

Add autoEscape option, |safe filter and |e,|htmlEscape filters#114
iffy wants to merge 4 commits into
enthus1ast:masterfrom
iffy:autoescape

Conversation

@iffy

@iffy iffy commented Aug 28, 2025

Copy link
Copy Markdown

Fixes #94

Let me know what you think of this approach.

@enthus1ast

enthus1ast commented Sep 6, 2025

Copy link
Copy Markdown
Owner

Thank you @iffy this looks really good!
I think supporting html only for the moment is good enough.

Could you:

  • inc the version to 0.11.0
  • add one entry in the readme's changelog (under done)
  • write a short entry in the readme that describes the feature

then i'll merge it

@iffy

iffy commented Sep 8, 2025

Copy link
Copy Markdown
Author

Thank you @iffy this looks really good! I think supporting html only for the moment is good enough.

Sounds good. Because of how you've made this lib, it would be really easy to support other escaping modes (besides HTML) by choosing a different proc for nwtStrProc. It was a pleasant surprise to see how nice this was to add. Kudos!

Could you:
* inc the version to 0.11.0
* add one entry in the readme's changelog (under done)
* write a short entry in the readme that describes the feature

All done! Let me know if more changes are needed.

@heuer

heuer commented Oct 29, 2025

Copy link
Copy Markdown

Wouldn't it be sufficient to utilize escape proc of std/xmltree instead of implementing htmlEscape?
See https://nim-lang.org/docs/xmltree.html#escape%2Cstring

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.

Autoescape HTML?

3 participants