From f5157c41847764ad2b41ee974f2f490d6b42afa7 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 30 Jan 2024 15:54:00 +0100 Subject: [PATCH] Fix other tests --- packages/string-templates/manifest.json | 8 ++++---- packages/string-templates/scripts/gen-collection-info.js | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/string-templates/manifest.json b/packages/string-templates/manifest.json index d06a01f606..dce4af8665 100644 --- a/packages/string-templates/manifest.json +++ b/packages/string-templates/manifest.json @@ -264,7 +264,7 @@ "numArgs": 2, "example": "{{equalsLength [1, 2, 3] 3}} -> true", "description": "

Returns true if the the length of the given value is equal to the given length. Can be used as a block or inline helper.

\n", - "requiresBlock": true + "requiresBlock": false }, "last": { "args": [ @@ -293,7 +293,7 @@ "numArgs": 2, "example": "{{equalsLength [1, 2, 3] 3}} -> true", "description": "

Returns true if the the length of the given value is equal to the given length. Can be used as a block or inline helper.

\n", - "requiresBlock": true + "requiresBlock": false }, "map": { "args": [ @@ -906,7 +906,7 @@ "numArgs": 2, "example": "{{uppercase 'aBcDef'}} -> ABCDEF", "description": "

Uppercase all of the characters in the given string. If used as a block helper it will uppercase the entire block. This helper does not support inverse blocks.

\n", - "requiresBlock": true + "requiresBlock": false } }, "comparison": { @@ -931,7 +931,7 @@ "numArgs": 4, "example": "{{compare 10 '<' 5 }} -> false", "description": "

Render a block when a comparison of the first and third arguments returns true. The second argument is the [arithemetic operator][operators] to use. You may also optionally specify an inverse block to render when falsy.

\n", - "requiresBlock": true + "requiresBlock": false }, "contains": { "args": [ diff --git a/packages/string-templates/scripts/gen-collection-info.js b/packages/string-templates/scripts/gen-collection-info.js index 1b540c829c..ed57fe7fae 100644 --- a/packages/string-templates/scripts/gen-collection-info.js +++ b/packages/string-templates/scripts/gen-collection-info.js @@ -115,7 +115,8 @@ function getCommentInfo(file, func) { docs.example = docs.example.replace("product", "multiply") } docs.description = blocks[0].trim() - docs.requiresBlock = docs.tags.some(el => el.title === "block") + docs.acceptsBlock = docs.tags.some(el => el.title === "block") + docs.acceptsInline = docs.tags.some(el => el.title === "inline") return docs } @@ -160,7 +161,7 @@ function run() { numArgs: args.length, example: jsDocInfo.example || undefined, description: jsDocInfo.description, - requiresBlock: jsDocInfo.requiresBlock, + requiresBlock: jsDocInfo.acceptsBlock && !jsDocInfo.acceptsInline, }) } outputJSON[collection] = collectionInfo