Hi guys,

I'm currently using ForEachTiddler plugin to display a list of recently 
edited tiddlers along with the first line of each. Here is my code:

<<forEachTiddler
    sortBy 
        tiddler.modified
    descending

    script '
        function lastDays(tiddler) {
            var compareDate = new Date();
            compareDate.setDate(compareDate.getDate() - 5);  
            if (tiddler.modified > compareDate && 
!tiddler.tags.contains("excludeLists") && 
!tiddler.tags.contains("systemConfig") && 
tiddler.tags.contains("bookfile")){
                var previewText = 
tiddler.text.substring(0,150).replace(/(\r\n|\n|\r)/gm," ") + "...";
                return "[[" + tiddler.title + "]]\n{{small borderleft{" + 
previewText + "}}}\n\n";}
            else 
                return ""; 
        }
    '

    write 'context.output+= lastDays(tiddler) , ""'

        begin 'context.output = ""'

        end 'context.output
                ? context.output
                : "<<tiddler [[List the 4 most recently modified 
tiddlers]]\>\>"        
        '
>>

The problem is that tiddlywiki evidently runs the wikify command *after *all 
the content has been written, resulting in a number of markup errors (e.g. 
unclosed //, @@, etc.)

How can I modify this code so that it displays correctly?

Thanks,
Meta

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/tiddlywiki/-/E01Ui-2VES8J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to