diff --git a/src/resources/editor/tools/vs-code.mjs b/src/resources/editor/tools/vs-code.mjs index 4e9ee07760e..4d8bcc41a92 100644 --- a/src/resources/editor/tools/vs-code.mjs +++ b/src/resources/editor/tools/vs-code.mjs @@ -8215,6 +8215,24 @@ var require_yaml_intelligence_resources = __commonJS({ long: "Location of output relative to the code that generated it. The possible values are as follows:\n\n- `default`: Normal flow of the slide after the code\n- `fragment`: In a fragment (not visible until you advance)\n- `slide`: On a new slide after the curent one\n- `column`: In an adjacent column \n- `column-fragment`: In an adjacent column (not visible until you advance)\n\nNote that this option is supported only for the `revealjs` format.\n" } }, + { + name: "warning", + tags: { + engine: "knitr" + }, + schema: { + enum: [ + true, + false, + "NA" + ] + }, + default: true, + description: { + short: "Include warning in rendered output.", + long: "Include warnings in rendered output. Possible values are `true`, `false`, or `NA`. \nIf `true`, messages are included in the output. If `false`, messages are not included. \nIf `NA`, messages are not included in output but shown in the knitr log to console.\n" + } + }, { name: "message", tags: { @@ -21651,7 +21669,7 @@ var require_yaml_intelligence_resources = __commonJS({ "Short/abbreviated form of container-title;", "A minor contributor to the item; typically cited using \u201Cwith\u201D before\nthe name when listed in a bibliography.", "Curator of an exhibit or collection (e.g. in a museum).", - "Physical (e.g. size) or temporal (e.g.\uFFFD\uFFFDrunning time) dimensions of\nthe item.", + "Physical (e.g. size) or temporal (e.g. running time) dimensions of\nthe item.", "Director (e.g. of a film).", "Minor subdivision of a court with a jurisdiction for a\nlegal item", "(Container) edition holding the item (e.g. \u201C3\u201D when citing a chapter\nin the third edition of a book).", @@ -24196,12 +24214,12 @@ var require_yaml_intelligence_resources = __commonJS({ mermaid: "%%" }, "handlers/mermaid/schema.yml": { - _internalId: 194269, + _internalId: 194272, type: "object", description: "be an object", properties: { "mermaid-format": { - _internalId: 194261, + _internalId: 194264, type: "enum", enum: [ "png", @@ -24217,7 +24235,7 @@ var require_yaml_intelligence_resources = __commonJS({ exhaustiveCompletions: true }, theme: { - _internalId: 194268, + _internalId: 194271, type: "anyOf", anyOf: [ { @@ -24817,8 +24835,8 @@ function mappedIndexToLineCol(eitherText) { }; } function mappedLines(str2, keepNewLines = false) { - const lines3 = rangedLines(str2.value, keepNewLines); - return lines3.map((v) => mappedString(str2, [v.range])); + const lines2 = rangedLines(str2.value, keepNewLines); + return lines2.map((v) => mappedString(str2, [v.range])); } // parsing.ts @@ -30795,6 +30813,27 @@ function createLocalizedError(obj) { }; } +// ../is-circular.ts +var isCircular = (obj) => { + const objectSet = /* @__PURE__ */ new WeakSet(); + const detect = (obj2) => { + if (obj2 && typeof obj2 === "object") { + if (objectSet.has(obj2)) { + return true; + } + objectSet.add(obj2); + for (const key in obj2) { + if (Object.hasOwn(obj2, key) && detect(obj2[key])) { + return true; + } + } + objectSet.delete(obj2); + } + return false; + }; + return detect(obj); +}; + // annotated-yaml.ts function postProcessAnnotation(parse) { if (parse.components.length === 1 && parse.start === parse.components[0].start && parse.end === parse.components[0].end) { @@ -30945,16 +30984,10 @@ function buildJsYamlAnnotation(mappedYaml) { `Expected a single result, got ${results.length} instead` ); } - try { - JSON.stringify(results[0]); - } catch (e) { - if (e.message.match("invalid string length")) { - } else if (e.message.match(/circular structure/)) { - throw new InternalError( - `Circular structure detected in parsed yaml: ${e.message}` - ); - } else { - } + if (isCircular(results[0])) { + throw new InternalError( + `Circular structure detected in yaml` + ); } return postProcessAnnotation(results[0]); } diff --git a/src/resources/editor/tools/yaml/web-worker.js b/src/resources/editor/tools/yaml/web-worker.js index 4d3273d8d1a..dc5e85a4cf8 100644 --- a/src/resources/editor/tools/yaml/web-worker.js +++ b/src/resources/editor/tools/yaml/web-worker.js @@ -8216,6 +8216,24 @@ try { long: "Location of output relative to the code that generated it. The possible values are as follows:\n\n- `default`: Normal flow of the slide after the code\n- `fragment`: In a fragment (not visible until you advance)\n- `slide`: On a new slide after the curent one\n- `column`: In an adjacent column \n- `column-fragment`: In an adjacent column (not visible until you advance)\n\nNote that this option is supported only for the `revealjs` format.\n" } }, + { + name: "warning", + tags: { + engine: "knitr" + }, + schema: { + enum: [ + true, + false, + "NA" + ] + }, + default: true, + description: { + short: "Include warning in rendered output.", + long: "Include warnings in rendered output. Possible values are `true`, `false`, or `NA`. \nIf `true`, messages are included in the output. If `false`, messages are not included. \nIf `NA`, messages are not included in output but shown in the knitr log to console.\n" + } + }, { name: "message", tags: { @@ -21652,7 +21670,7 @@ try { "Short/abbreviated form of container-title;", "A minor contributor to the item; typically cited using \u201Cwith\u201D before\nthe name when listed in a bibliography.", "Curator of an exhibit or collection (e.g. in a museum).", - "Physical (e.g. size) or temporal (e.g.\uFFFD\uFFFDrunning time) dimensions of\nthe item.", + "Physical (e.g. size) or temporal (e.g. running time) dimensions of\nthe item.", "Director (e.g. of a film).", "Minor subdivision of a court with a jurisdiction for a\nlegal item", "(Container) edition holding the item (e.g. \u201C3\u201D when citing a chapter\nin the third edition of a book).", @@ -24197,12 +24215,12 @@ try { mermaid: "%%" }, "handlers/mermaid/schema.yml": { - _internalId: 194269, + _internalId: 194272, type: "object", description: "be an object", properties: { "mermaid-format": { - _internalId: 194261, + _internalId: 194264, type: "enum", enum: [ "png", @@ -24218,7 +24236,7 @@ try { exhaustiveCompletions: true }, theme: { - _internalId: 194268, + _internalId: 194271, type: "anyOf", anyOf: [ { @@ -24831,8 +24849,8 @@ ${heading}`; }; } function mappedLines(str2, keepNewLines = false) { - const lines3 = rangedLines(str2.value, keepNewLines); - return lines3.map((v) => mappedString(str2, [v.range])); + const lines2 = rangedLines(str2.value, keepNewLines); + return lines2.map((v) => mappedString(str2, [v.range])); } // parsing.ts @@ -30809,6 +30827,27 @@ ${reindented} }; } + // ../is-circular.ts + var isCircular = (obj) => { + const objectSet = /* @__PURE__ */ new WeakSet(); + const detect = (obj2) => { + if (obj2 && typeof obj2 === "object") { + if (objectSet.has(obj2)) { + return true; + } + objectSet.add(obj2); + for (const key in obj2) { + if (Object.hasOwn(obj2, key) && detect(obj2[key])) { + return true; + } + } + objectSet.delete(obj2); + } + return false; + }; + return detect(obj); + }; + // annotated-yaml.ts function postProcessAnnotation(parse) { if (parse.components.length === 1 && parse.start === parse.components[0].start && parse.end === parse.components[0].end) { @@ -30959,16 +30998,10 @@ ${tidyverseInfo( `Expected a single result, got ${results.length} instead` ); } - try { - JSON.stringify(results[0]); - } catch (e) { - if (e.message.match("invalid string length")) { - } else if (e.message.match(/circular structure/)) { - throw new InternalError( - `Circular structure detected in parsed yaml: ${e.message}` - ); - } else { - } + if (isCircular(results[0])) { + throw new InternalError( + `Circular structure detected in yaml` + ); } return postProcessAnnotation(results[0]); } diff --git a/src/resources/editor/tools/yaml/yaml-intelligence-resources.json b/src/resources/editor/tools/yaml/yaml-intelligence-resources.json index b37443e99fe..36b72c4d05e 100644 --- a/src/resources/editor/tools/yaml/yaml-intelligence-resources.json +++ b/src/resources/editor/tools/yaml/yaml-intelligence-resources.json @@ -1187,6 +1187,24 @@ "long": "Location of output relative to the code that generated it. The possible values are as follows:\n\n- `default`: Normal flow of the slide after the code\n- `fragment`: In a fragment (not visible until you advance)\n- `slide`: On a new slide after the curent one\n- `column`: In an adjacent column \n- `column-fragment`: In an adjacent column (not visible until you advance)\n\nNote that this option is supported only for the `revealjs` format.\n" } }, + { + "name": "warning", + "tags": { + "engine": "knitr" + }, + "schema": { + "enum": [ + true, + false, + "NA" + ] + }, + "default": true, + "description": { + "short": "Include warning in rendered output.", + "long": "Include warnings in rendered output. Possible values are `true`, `false`, or `NA`. \nIf `true`, messages are included in the output. If `false`, messages are not included. \nIf `NA`, messages are not included in output but shown in the knitr log to console.\n" + } + }, { "name": "message", "tags": { @@ -14623,7 +14641,7 @@ "Short/abbreviated form of container-title;", "A minor contributor to the item; typically cited using “with” before\nthe name when listed in a bibliography.", "Curator of an exhibit or collection (e.g. in a museum).", - "Physical (e.g. size) or temporal (e.g.��running time) dimensions of\nthe item.", + "Physical (e.g. size) or temporal (e.g. running time) dimensions of\nthe item.", "Director (e.g. of a film).", "Minor subdivision of a court with a jurisdiction for a\nlegal item", "(Container) edition holding the item (e.g. “3” when citing a chapter\nin the third edition of a book).", @@ -17168,12 +17186,12 @@ "mermaid": "%%" }, "handlers/mermaid/schema.yml": { - "_internalId": 194269, + "_internalId": 194272, "type": "object", "description": "be an object", "properties": { "mermaid-format": { - "_internalId": 194261, + "_internalId": 194264, "type": "enum", "enum": [ "png", @@ -17189,7 +17207,7 @@ "exhaustiveCompletions": true }, "theme": { - "_internalId": 194268, + "_internalId": 194271, "type": "anyOf", "anyOf": [ { diff --git a/src/resources/formats/html/esbuild-analysis-cache.json b/src/resources/formats/html/esbuild-analysis-cache.json index 61165dbc321..110a06d005f 100644 --- a/src/resources/formats/html/esbuild-analysis-cache.json +++ b/src/resources/formats/html/esbuild-analysis-cache.json @@ -2,7 +2,7 @@ "quarto.js": { "inputs": { "quarto.js": { - "bytes": 26327, + "bytes": 26396, "imports": [], "format": "esm" } @@ -20,10 +20,10 @@ "entryPoint": "quarto.js", "inputs": { "quarto.js": { - "bytesInOutput": 21890 + "bytesInOutput": 21946 } }, - "bytes": 21890 + "bytes": 21946 } } } diff --git a/src/resources/schema/cell-textoutput.yml b/src/resources/schema/cell-textoutput.yml index c6453a203c1..fa1d183b58a 100644 --- a/src/resources/schema/cell-textoutput.yml +++ b/src/resources/schema/cell-textoutput.yml @@ -69,6 +69,19 @@ Note that this option is supported only for the `revealjs` format. +- name: warning + tags: + engine: knitr + schema: + enum: [true, false, NA] + default: true + description: + short: Include warning in rendered output. + long: | + Include warnings in rendered output. Possible values are `true`, `false`, or `NA`. + If `true`, messages are included in the output. If `false`, messages are not included. + If `NA`, messages are not included in output but shown in the knitr log to console. + - name: message tags: engine: knitr