You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Function to parse through some text and replace each occurrence of words/substrings of interest with wrapped/"highlighted" text, e.g. foo to <em>foo</em>.
We'd want options to enable or prevent highlighting/wrapping partial words.
Some examples of how this might work:
"This is example text." | highlight(needle='example', html='<span class="highlight">')
→ "This is <span class="highlight">example</span> text."
"This is example text." | wrapWords(words=['this', 'example'], before='~', after='%', caseSensitive=false )
→ "~This% is ~example% text."
"This is example text; this is nifty." | wrap(needle=['this', 'ex'], before='~', after='%', caseSensitive=true )
→ "This is ~ex%ample text; ~this% is nifty."
The text was updated successfully, but these errors were encountered:
Function to parse through some text and replace each occurrence of words/substrings of interest with wrapped/"highlighted" text, e.g.
foo
to<em>foo</em>
.We'd want options to enable or prevent highlighting/wrapping partial words.
Some examples of how this might work:
"This is example text." | highlight(needle='example', html='<span class="highlight">')
→
"This is <span class="highlight">example</span> text."
"This is example text." | wrapWords(words=['this', 'example'], before='~', after='%', caseSensitive=false )
→
"~This% is ~example% text."
"This is example text; this is nifty." | wrap(needle=['this', 'ex'], before='~', after='%', caseSensitive=true )
→
"This is ~ex%ample text; ~this% is nifty."
The text was updated successfully, but these errors were encountered: