-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create template function to remove non-printable characters #11255
Comments
If you need additional assistance, please use the forum (https://discourse.gohugo.io/) for questions and troubleshooting. We prefer to use GitHub for verified bugs and vetted enhancements. Thanks. |
OK, I see it now. Reopening. |
First, the Second, the So, there's no bug here, but possibly an enhancement: create a template function that removes non-printable characters. This gets a bit tricky because sometimes you may want to remove them, and at other times replace them with a space (e.g., tab should be replaced by space, but zero-width space should not). I think these would have to be special-cased. For now I think you have three options:
|
­
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. |
Still relevant |
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes.
Issue description
As far as I can tell, no combination of
plainify
,safeHTML
,markdownify
, orhtml{Une,E}scape
can fully remove soft hyphens, and at best converts them to\uad
, the only exception I found beinganchorize
which does successfully remove them.I'm not sure which functions out of the above should be able to remove soft hyphens or not (my guess would be
plainify
, since it's meant to "strip HTML tags"), but for now, usingreplace .Var "­" ""
is the only way other thananchorize
that I've found.The text was updated successfully, but these errors were encountered: