Silly question, but I’m a bit stuck on this.
I have several texts that I need to convert to links. I do this by using the urlize
function which works.
The issue comes when there’s a “+” in the text. The urlize
function converts the plus into “–” instead of “-”. I assume this is normal behavior. How would I go about this if I just want “+” to be replaced with “-”?
Is there a better way than using a replace
statement?
Example:
myText = “This is my text”
{{.Params.myText | urlize}} --> this-is-my-text
myText = “This is my text + something”
{{.Params.myText | urlize}} --> this-is-my-text--something
The behavior I want:
{{.Params.myText | urlize}} --> this-is-my-text-something