Hello:
I am working on a macro to highlight target strings within the text field
of a tiddler.
The use case is to make it easier to for me see where the targetStrings are
(if any).
My question is how to highlight the targetString in the macro (ie. treating
the macro as a string) as opposed to (apparently) executing the macro
and highlighting the targetString in the output.
!!! Here is the macro
```
\define formatTid.highlightText(inputText targetString)
<$set name="outputText" filter="[[$inputText$]]
+[splitregexp[\b$targetString$\b]join[@@color:blue;$targetString$@@]]"
select="0">
| ''outputText''|<<outputText>> |
\end
<$macrocall $name="formatTid.highlightText"
inputText={{highlightTest.sentence!!text}} targetString="goFish"/>
```
The macro works as expected (goFish is highlighted in blue) when the text
field contains
```
This goFish is in a sentence.
```
The macro works partially (i.e., goFish is highlighted only for the
comment).
```
\define goFish()
!!! This example has three instances of goFish.
\end
<<goFish>>
```
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/8a9ea408-11fb-4e2e-995b-f3e3f04a288ao%40googlegroups.com.