Mark,

I see split before and split after may be away to operate on a string, I 
may need to treat the whole text field as a single string, and deal with 
multiple matches.

I will explore that but it would help if we could set values and flags 
within content. Set and vars have closing statements, and macros are 
defined once.

Regards
Tony

On Sunday, July 26, 2020 at 1:56:35 PM UTC+10, Mark S. wrote:
>
>
> Hi Tony,
>
> I think Mohammad's *refnotes* project may do something like this.
>
> The algorithm, as I understand it is
>
>   1. Look for the first marker in the string using splitbefore
>   2. Use the result from (1) to remove the prefix from the original string
>   3. Look for the 2nd marker in the string from (2) using splitbefore. The 
> result is one of the strings you want. Output the string.
>   4. Use the result from (3) to remove any prefix from the original 
> string. That string then becomes the new "original" string, and is fed back 
> to (1) recursively.
>
> All of this could be done much more easily with PR 2963.
>
>
> On Saturday, July 25, 2020 at 6:34:11 PM UTC-7, TW Tones wrote:
>>
>> Folks,
>>
>> The following objective I believe exposes a limitation in tiddlywiki I 
>> would like to resolve; however I wish to find at least a work around for 
>> now.
>>
>> I am just writing a macro to process lines in a tiddler
>> <$tiddler tiddler=<<tiddlername>> >
>> <$list filter="[all[current]get[text]splitregexp[\n]]" variable=line>
>>
>> </$list>
>> </$tiddler> 
>>
>> However inside the list, I want to process each line, 
>>
>>    - However I wish to detect a start and end condition and display only 
>>    the lines including and between the start and end condition.
>>    - This start and end condition may occur more than once in the same 
>>    tiddler.
>>    - A real world example may be extracting the content between an open 
>>    and close html div or section tag.
>>
>> To do this my first idea so far is 
>>
>>    - setting a flag at the start of when the condition is met, 
>>    - displaying each line when this flag is on
>>    - and turning the flag off when the end condition is met.
>>
>> However this flag would be a variable in the traditional (non tiddlywiki 
>> sense) and I do not believe we have one in, tiddlywiki that does not 
>> require a trigger to set a text reference to that value. This is a gap I 
>> have recognised for some time but had trouble communicating.
>>
>> A second idea is to "call a sub-routine", while the condition is met, 
>>
>>    - but to do this we need to have the ability to request the next line 
>>    from the source tiddler
>>    - We can not do this to my knowledge because the flow must return to 
>>    the next item in the list that calls the subroutine.
>>
>>
>> Can anyone share a solution to this issues please?
>>
>> thanks in advance for considering this
>> TW Tones
>>
>>
>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/ff9f8197-d23f-4c2a-88b1-caf6edfb5ac2o%40googlegroups.com.

Reply via email to