-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Add limit option for replaceRE and replace #7586
Comments
That sounds good. |
+1 Use case: Automatically wrap a link on a word (glossary) in the content without creating multiple/redundant occurrences of that link. |
I've submitted a PR for consideration that updates The stdlib |
Go stdlib doesn't contain a limited replace in the regexp package, but we can accomplish the same thing with ReplaceAllStringFunc. Fixes gohugoio#7586
Go stdlib doesn't contain a limited replace in the regexp package, but we can accomplish the same thing with ReplaceAllStringFunc. Fixes #7586
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'd like to propose adding an optional
limit
param forreplaceRE
andreplace
functions that works exactly the same aslimit
infindRE
.Example use case: Process article content and automatically add links to glossary terms for first occurrences of every word from glossary.
cc: @fplanque
The text was updated successfully, but these errors were encountered: