mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-25 06:35:46 +00:00
@@ -1088,10 +1088,6 @@ Tests the filtering mechanism.
|
||||
expect(wiki.filterTiddlers("[[representation]makepatches[misreprehensionisation]]").join(" ")).toBe("@@ -1,13 +1,21 @@\n+mis\n repre\n-sent\n+hensionis\n atio\n");
|
||||
expect(wiki.filterTiddlers("[[the cat sat on the mat]makepatches[the hat saw in every category]]").join(" ")).toBe("@@ -1,22 +1,29 @@\n the \n-c\n+h\n at sa\n-t on the mat\n+w in every category\n");
|
||||
});
|
||||
|
||||
it("should handle the macro operator", () => {
|
||||
expect(wiki.filterTiddlers("[macro[makedatauri],[some example text],[text/plain]]").join("")).toBe("data:text/plain,some%20example%20text");
|
||||
});
|
||||
|
||||
it("should parse filter variable parameters", function(){
|
||||
expect($tw.utils.parseFilterVariable("currentTiddler")).toEqual(
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
created: 20260104045032090
|
||||
modified: 20260104045240842
|
||||
tags: [[macro Operator]]
|
||||
title: macro Operator (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.operator-example 1 "[macro[now],{$:/config/NewJournal/Title}]">>
|
||||
@@ -1,14 +0,0 @@
|
||||
caption: macro
|
||||
created: 20260104043647022
|
||||
modified: 20260104045136808
|
||||
op-input: ignored
|
||||
op-output: the result of the javascript macro
|
||||
op-parameter: first parameter is the javascript macro, subsequent parameters are passed to the macro by position
|
||||
op-purpose: return the result from a javascript macro (with indirect parameters support)
|
||||
tags: [[Filter Operators]]
|
||||
title: macro Operator
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<.from-version "5.4.0">> The <<.op macro>> operator applies a javascript macro to the input titles, and returns the result from the macro. The function is invoked once with all of the input titles.
|
||||
|
||||
<<.operator-examples "macro">>
|
||||
@@ -1,10 +0,0 @@
|
||||
title: $:/changenotes/5.4.0/#9520
|
||||
description: Add macro operator
|
||||
release: 5.4.0
|
||||
tags: $:/tags/ChangeNote
|
||||
change-type: feature
|
||||
change-category: filters
|
||||
github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9520
|
||||
github-contributors: Leilei332
|
||||
|
||||
Added [[macro Operator]] for evaluating javascript macros in filters.
|
||||
Reference in New Issue
Block a user