Skip to content

Commit 02c1a9a

Browse files
committed
merge
2 parents e2179e5 + fd2eafc commit 02c1a9a

99 files changed

Lines changed: 950 additions & 147 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

news/changelog-1.9.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All changes included in 1.9:
44

55
- ([#13342](https://github.com/quarto-dev/quarto-cli/issues/13342)): Ensure that the `contents` shortcode works inside metadata.
66
- ([#13489](https://github.com/quarto-dev/quarto-cli/issues/13489)): Add `mode=plain` option to the `kbd` shortcode to render keyboard shortcuts exactly as written, without OS-specific symbol translation.
7+
- ([#14061](https://github.com/quarto-dev/quarto-cli/issues/14061)): Fix `meta` shortcode not preserving line breaks in values. The shortcode now respects its usage context (block, inline, or text) and preserves paragraph breaks in block and code block contexts.
78

89
## Regression fixes
910

@@ -51,6 +52,7 @@ All changes included in 1.9:
5152
- ([#13825](https://github.com/quarto-dev/quarto-cli/issues/13825)): Fix `column: margin` not working with `renderings: [light, dark]` option. Column classes are now preserved when applying theme classes to cell outputs.
5253
- ([#13883](https://github.com/quarto-dev/quarto-cli/issues/13883)): Fix unequal top/bottom spacing in simple untitled callouts.
5354
- ([#13900](https://github.com/quarto-dev/quarto-cli/issues/13900)): Warn when `renderings` cell option contains duplicate names. Previously, duplicate names like `[dark, light, dark, light]` would silently use only the last output for each name.
55+
- ([#14065](https://github.com/quarto-dev/quarto-cli/issues/14065)): Fix `SCSSParsingError` when custom SCSS themes contain non-ASCII characters in selectors (e.g., `#présentation`).
5456

5557
### `typst`
5658

@@ -63,6 +65,7 @@ All changes included in 1.9:
6365
- ([#13745](https://github.com/quarto-dev/quarto-cli/issues/13745)): Fix relative `font-paths` from extensions or document metadata not resolving correctly for Typst compilation. Relative paths are now resolved against the document directory before being passed to the Typst CLI.
6466
- ([#13775](https://github.com/quarto-dev/quarto-cli/issues/13775)): Fix brand fonts not being applied when using `citeproc: true` with Typst format. Format detection now properly handles Pandoc format variants like `typst-citations`.
6567
- ([#13868](https://github.com/quarto-dev/quarto-cli/issues/13868)): Add image alt text support for PDF/UA accessibility. Alt text from markdown captions and explicit `alt` attributes is now passed to Typst's `image()` function. (Temporary workaround until [jgm/pandoc#11394](https://github.com/jgm/pandoc/pull/11394) is merged.)
68+
- ([#13917](https://github.com/quarto-dev/quarto-cli/issues/13917)): Fix brand logo paths not resolving correctly for Typst documents in project subdirectories. Brand logo paths are now converted to project-absolute paths before merging with document metadata, replacing the fragile `projectOffset()` workaround.
6669
- ([#13249](https://github.com/quarto-dev/quarto-cli/pull/13249)): Update to Pandoc's Typst template following Pandoc 3.8.3 and Typst 0.14.2 support:
6770
- Code syntax highlighting now uses Skylighting by default.
6871
- New template variables `mathfont`, `codefont`, and `linestretch` for font and line spacing customization.
@@ -120,6 +123,7 @@ All changes included in 1.9:
120123
- ([#13932](https://github.com/quarto-dev/quarto-cli/pull/13932)): Add `llms-txt: true` option to generate LLM-friendly content for websites. Creates `.llms.md` markdown files alongside HTML pages and a root `llms.txt` index file following the [llms.txt](https://llmstxt.org/) specification.
121124
- ([#13951](https://github.com/quarto-dev/quarto-cli/issues/13951)): Fix `image-lazy-loading` not applying `loading="lazy"` attribute to auto-detected listing images.
122125
- ([#14003](https://github.com/quarto-dev/quarto-cli/pull/14003)): Add text fragments to search result links so browsers scroll to and highlight the matched text on the target page.
126+
- ([#9802](https://github.com/quarto-dev/quarto-cli/issues/9802), [#14047](https://github.com/quarto-dev/quarto-cli/issues/14047)): Fix search term highlighting disappearing on page scroll or layout events when navigating from search results. (author: @jtbayly, [#13442](https://github.com/quarto-dev/quarto-cli/pull/13442))
123127

124128
### `book`
125129

src/core/brand/brand.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,45 @@ export function logoAddLeadingSlashes(
425425
};
426426
}
427427

428+
// Return a copy of the brand with logo paths converted from project-relative
429+
// to project-absolute (leading /). Typst resolves these via --root, which
430+
// points to the project directory. Call this before resolveLogo so that
431+
// brand-sourced paths get the / prefix while document-sourced paths are
432+
// left untouched.
433+
export function brandWithAbsoluteLogoPaths(
434+
brand: LightDarkBrand | undefined,
435+
): LightDarkBrand | undefined {
436+
if (!brand) {
437+
return brand;
438+
}
439+
const transformBrand = (b: Brand | undefined): Brand | undefined => {
440+
if (!b) return b;
441+
const oldLogo = b.processedData.logo;
442+
const logo: ProcessedBrandData["logo"] = { images: {} };
443+
for (const size of Zod.BrandNamedLogo.options) {
444+
if (oldLogo[size]) {
445+
logo[size] = {
446+
...oldLogo[size],
447+
path: ensureLeadingSlashIfNotExternal(oldLogo[size]!.path),
448+
};
449+
}
450+
}
451+
for (const [key, value] of Object.entries(oldLogo.images)) {
452+
logo.images[key] = {
453+
...value,
454+
path: ensureLeadingSlashIfNotExternal(value.path),
455+
};
456+
}
457+
const copy = Object.create(b) as Brand;
458+
copy.processedData = { ...b.processedData, logo };
459+
return copy;
460+
};
461+
return {
462+
light: transformBrand(brand.light),
463+
dark: transformBrand(brand.dark),
464+
};
465+
}
466+
428467
// this a typst workaround but might as well write it as a proper function
429468
export function fillLogoPaths(
430469
brand: LightDarkBrand | undefined,

src/core/sass/add-css-vars.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ import { getVariableDependencies } from "./analyzer/get-dependencies.ts";
1616

1717
const { getSassAst } = makeParserModule(parse);
1818

19+
// Reverse the _u<hex>_ encoding applied in parse.ts so that
20+
// variable names emitted into the CSS vars block match the
21+
// original SCSS source that Dart Sass compiles against.
22+
// Non-ASCII codepoints are valid in CSS custom property names since they
23+
// follow the <ident> production (see spec references in parse.ts).
24+
const decodeScssName = (name: string) =>
25+
name.replace(/_u([0-9a-f]+)_/g, (_, hex: string) =>
26+
String.fromCodePoint(parseInt(hex, 16))
27+
);
28+
1929
export class SCSSParsingError extends Error {
2030
constructor(message: string) {
2131
super(`SCSS Parsing Error: ${message}`);
@@ -38,7 +48,8 @@ export const cssVarsBlock = (scssSource: string) => {
3848
for (const [dep, _] of deps) {
3949
const decl = ast.get(dep);
4050
if (decl.valueType === "color") {
41-
output.push(`--quarto-scss-export-${dep}: #{$${dep}};`);
51+
const originalName = decodeScssName(dep);
52+
output.push(`--quarto-scss-export-${originalName}: #{$${originalName}};`);
4253
}
4354
}
4455
output.push("}");

src/core/sass/analyzer/parse.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,21 @@ export const makeParserModule = (
4141
"$1: $2",
4242
);
4343

44+
// scss-parser's tokenizer only handles ASCII identifier characters.
45+
// Non-ASCII codepoints are valid in both CSS and SCSS identifiers:
46+
// - CSS Syntax L3 §4.2 defines "ident code point" as including any
47+
// codepoint >= U+0080 (https://www.w3.org/TR/css-syntax-3/#ident-code-point)
48+
// - CSS2 grammar includes `nonascii` in `nmstart`/`nmchar` productions
49+
// (https://www.w3.org/TR/CSS2/grammar.html#scanner)
50+
// - Sass inherits CSS's <ident-token> grammar for identifiers
51+
// (https://github.com/sass/sass/blob/main/spec/syntax.md)
52+
// Dart Sass handles them correctly, so we encode here as ASCII
53+
// placeholders for analysis only, then decode in add-css-vars.ts.
54+
contents = contents.replaceAll(
55+
/[^\x00-\x7F]/g,
56+
(ch) => `_u${ch.codePointAt(0)!.toString(16)}_`,
57+
);
58+
4459
// This is relatively painful, because unfortunately the error message of scss-parser
4560
// is not helpful.
4661

src/format/typst/format-typst.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ import {
3737
BrandNamedLogo,
3838
LogoLightDarkSpecifier,
3939
} from "../../resources/types/schema-types.ts";
40-
import { fillLogoPaths, resolveLogo } from "../../core/brand/brand.ts";
40+
import {
41+
brandWithAbsoluteLogoPaths,
42+
fillLogoPaths,
43+
resolveLogo,
44+
} from "../../core/brand/brand.ts";
4145
import { LogoLightDarkSpecifierPathOptional } from "../../resources/types/zod/schema-types.ts";
4246

4347
const typstBookExtension: BookExtension = {
@@ -98,6 +102,10 @@ export function typstFormat(): Format {
98102
}
99103

100104
const brand = format.render.brand;
105+
// For Typst, convert brand logo paths to project-absolute (with /)
106+
// before merging with document logo metadata. Typst resolves / paths
107+
// via --root which points to the project directory.
108+
const typstBrand = brandWithAbsoluteLogoPaths(brand);
101109
const logoSpec = format
102110
.metadata[kLogo] as LogoLightDarkSpecifierPathOptional;
103111
const sizeOrder: BrandNamedLogo[] = [
@@ -108,8 +116,8 @@ export function typstFormat(): Format {
108116
// temporary: if document logo has object or light/dark objects
109117
// without path, do our own findLogo to add the path
110118
// typst is the exception not needing path but we'll probably deprecate this
111-
const logo = fillLogoPaths(brand, logoSpec, sizeOrder);
112-
format.metadata[kLogo] = resolveLogo(brand, logo, sizeOrder);
119+
const logo = fillLogoPaths(typstBrand, logoSpec, sizeOrder);
120+
format.metadata[kLogo] = resolveLogo(typstBrand, logo, sizeOrder);
113121
// force columns to wrap and move any 'columns' setting to metadata
114122
const columns = format.pandoc[kColumns];
115123
if (columns) {

src/resources/editor/tools/vs-code.mjs

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13530,7 +13530,8 @@ var require_yaml_intelligence_resources = __commonJS({
1353013530
schema: "string",
1353113531
tags: {
1353213532
formats: [
13533-
"$pdf-all"
13533+
"$pdf-all",
13534+
"typst"
1353413535
]
1353513536
},
1353613537
description: "The contents of an acknowledgments footnote after the document title."
@@ -13859,12 +13860,13 @@ var require_yaml_intelligence_resources = __commonJS({
1385913860
formats: [
1386013861
"$html-doc",
1386113862
"context",
13862-
"$pdf-all"
13863+
"$pdf-all",
13864+
"typst"
1386313865
]
1386413866
},
1386513867
description: {
1386613868
short: "Sets the color of hyperlinks in the document.",
13867-
long: "For HTML output, sets the CSS `color` property on all links.\n\nFor LaTeX output, The color used for internal links using color options\nallowed by [`xcolor`](https://ctan.org/pkg/xcolor), \nincluding the `dvipsnames`, `svgnames`, and\n`x11names` lists.\n\nFor ConTeXt output, sets the color for both external links and links within the document.\n"
13869+
long: "For HTML output, sets the CSS `color` property on all links.\n\nFor LaTeX output, The color used for internal links using color options\nallowed by [`xcolor`](https://ctan.org/pkg/xcolor),\nincluding the `dvipsnames`, `svgnames`, and\n`x11names` lists.\n\nFor ConTeXt output, sets the color for both external links and links within the document.\n\nFor Typst output, sets the color of internal hyperlinks using Typst color syntax.\n"
1386813870
}
1386913871
},
1387013872
{
@@ -13898,25 +13900,27 @@ var require_yaml_intelligence_resources = __commonJS({
1389813900
schema: "string",
1389913901
tags: {
1390013902
formats: [
13901-
"$pdf-all"
13903+
"$pdf-all",
13904+
"typst"
1390213905
]
1390313906
},
1390413907
description: {
13905-
short: "The color used for external links using color options allowed by `xcolor`",
13906-
long: "The color used for external links using color options\nallowed by [`xcolor`](https://ctan.org/pkg/xcolor), \nincluding the `dvipsnames`, `svgnames`, and\n`x11names` lists.\n"
13908+
short: "The color used for external links.",
13909+
long: "For LaTeX output, the color used for external links using color options\nallowed by [`xcolor`](https://ctan.org/pkg/xcolor),\nincluding the `dvipsnames`, `svgnames`, and\n`x11names` lists.\n\nFor Typst output, sets the color of external file links using Typst color syntax.\n"
1390713910
}
1390813911
},
1390913912
{
1391013913
name: "citecolor",
1391113914
schema: "string",
1391213915
tags: {
1391313916
formats: [
13914-
"$pdf-all"
13917+
"$pdf-all",
13918+
"typst"
1391513919
]
1391613920
},
1391713921
description: {
13918-
short: "The color used for citation links using color options allowed by `xcolor`",
13919-
long: "The color used for citation links using color options\nallowed by [`xcolor`](https://ctan.org/pkg/xcolor), \nincluding the `dvipsnames`, `svgnames`, and\n`x11names` lists.\n"
13922+
short: "The color used for citation links.",
13923+
long: "For LaTeX output, the color used for citation links using color options\nallowed by [`xcolor`](https://ctan.org/pkg/xcolor),\nincluding the `dvipsnames`, `svgnames`, and\n`x11names` lists.\n\nFor Typst output, sets the color of citation links using Typst color syntax.\n"
1392013924
}
1392113925
},
1392213926
{
@@ -15138,6 +15142,19 @@ var require_yaml_intelligence_resources = __commonJS({
1513815142
long: "For HTML output, sets the CSS font-family property on code elements.\n\nFor PowerPoint output, sets the font used for code.\n\nFor LaTeX output, the monospace font family for use with `xelatex` or \n`lualatex`: take the name of any system font, using the\n[`fontspec`](https://ctan.org/pkg/fontspec) package. \n\nFor ConTeXt output, the monspace font family. Use the name of any \nsystem font. See [ConTeXt Fonts](https://wiki.contextgarden.net/Fonts) for more\ninformation.\n"
1513915143
}
1514015144
},
15145+
{
15146+
name: "codefont",
15147+
schema: "string",
15148+
tags: {
15149+
formats: [
15150+
"typst"
15151+
]
15152+
},
15153+
description: {
15154+
short: "Sets the font used for code in Typst output.",
15155+
long: "For Typst output, sets the font used for displaying code. Takes\nthe name of any font available to Typst (system fonts or fonts in\ndirectories specified by `font-paths`).\n"
15156+
}
15157+
},
1514115158
{
1514215159
name: "fontsize",
1514315160
schema: "string",
@@ -15216,12 +15233,13 @@ var require_yaml_intelligence_resources = __commonJS({
1521615233
schema: "string",
1521715234
tags: {
1521815235
formats: [
15219-
"$pdf-all"
15236+
"$pdf-all",
15237+
"typst"
1522015238
]
1522115239
},
1522215240
description: {
15223-
short: "The math font family for use with `xelatex` or `lualatex`.",
15224-
long: "The math font family for use with `xelatex` or \n`lualatex`. Takes the name of any system font, using the\n[`fontspec`](https://ctan.org/pkg/fontspec) package.\n"
15241+
short: "The math font family for use with `xelatex`, `lualatex`, or Typst.",
15242+
long: "For LaTeX output, the math font family for use with `xelatex` or\n`lualatex`. Takes the name of any system font, using the\n[`fontspec`](https://ctan.org/pkg/fontspec) package.\n\nFor Typst output, sets the font used for mathematical content.\n"
1522515243
}
1522615244
},
1522715245
{
@@ -15374,12 +15392,13 @@ var require_yaml_intelligence_resources = __commonJS({
1537415392
formats: [
1537515393
"$html-doc",
1537615394
"context",
15377-
"$pdf-all"
15395+
"$pdf-all",
15396+
"typst"
1537815397
]
1537915398
},
1538015399
description: {
1538115400
short: "Sets the line height or spacing for text in the document.",
15382-
long: "For HTML output sets the CSS `line-height` property on the html \nelement, which is preferred to be unitless.\n\nFor LaTeX output, adjusts line spacing using the \n[setspace](https://ctan.org/pkg/setspace) package, e.g. 1.25, 1.5.\n"
15401+
long: "For HTML output sets the CSS `line-height` property on the html\nelement, which is preferred to be unitless.\n\nFor LaTeX output, adjusts line spacing using the\n[setspace](https://ctan.org/pkg/setspace) package, e.g. 1.25, 1.5.\n\nFor Typst output, adjusts the spacing between lines of text.\n"
1538315402
}
1538415403
},
1538515404
{
@@ -23377,6 +23396,11 @@ var require_yaml_intelligence_resources = __commonJS({
2337723396
"Write markdown links as references rather than inline.",
2337823397
"Unique prefix for references (<code>none</code> to prevent automatic\nprefixes)",
2337923398
"Automatically re-render for preview whenever document is saved (note\nthat this requires a preview for the saved document be already running).\nThis option currently works only within VS Code.",
23399+
{
23400+
short: "Editor-specific options (used by RStudio and Positron).",
23401+
long: "Editor-specific options that control IDE behavior for this document.\nThese options are used by RStudio and Positron to configure per-document\neditor settings."
23402+
},
23403+
"Determines where chunk output is shown in the editor.",
2338023404
"Enable (<code>true</code>) or disable (<code>false</code>) Zotero for\na document. Alternatively, provide a list of one or more Zotero group\nlibraries to use with the document.",
2338123405
"The identifier for this publication.",
2338223406
"The identifier value.",
@@ -24752,6 +24776,10 @@ var require_yaml_intelligence_resources = __commonJS({
2475224776
short: "Visual style for theorem environments in Typst output.",
2475324777
long: "Controls how theorems, lemmas, definitions, etc. are rendered: -\n<code>simple</code>: Plain text with bold title and italic body\n(default) - <code>fancy</code>: Colored boxes using brand colors -\n<code>clouds</code>: Rounded colored background boxes -\n<code>rainbow</code>: Colored left border with colored title"
2475424778
},
24779+
{
24780+
short: "Email format version",
24781+
long: "Specifies which email format version to use."
24782+
},
2475524783
"Project configuration.",
2475624784
"Project type (<code>default</code>, <code>website</code>,\n<code>book</code>, or <code>manuscript</code>)",
2475724785
"Files to render (defaults to all files)",
@@ -25106,13 +25134,8 @@ var require_yaml_intelligence_resources = __commonJS({
2510625134
"internal-schema-hack",
2510725135
"List execution engines you want to give priority when determining\nwhich engine should render a notebook. If two engines have support for a\nnotebook, the one listed earlier will be chosen. Quarto\u2019s default order\nis \u2018knitr\u2019, \u2018jupyter\u2019, \u2018markdown\u2019, \u2018julia\u2019.",
2510825136
{
25109-
short: "Editor-specific options (used by RStudio and Positron).",
25110-
long: "Editor-specific options that control IDE behavior for this document.\nThese options are used by RStudio and Positron to configure per-document\neditor settings."
25111-
},
25112-
"Determines where chunk output is shown in the editor.",
25113-
{
25114-
short: "Email format version",
25115-
long: "Specifies which email format version to use."
25137+
short: "Sets the font used for code in Typst output.",
25138+
long: "For Typst output, sets the font used for displaying code. Takes the\nname of any font available to Typst (system fonts or fonts in\ndirectories specified by <code>font-paths</code>)."
2511625139
}
2511725140
],
2511825141
"schema/external-schemas.yml": [
@@ -25343,12 +25366,12 @@ var require_yaml_intelligence_resources = __commonJS({
2534325366
mermaid: "%%"
2534425367
},
2534525368
"handlers/mermaid/schema.yml": {
25346-
_internalId: 221802,
25369+
_internalId: 222606,
2534725370
type: "object",
2534825371
description: "be an object",
2534925372
properties: {
2535025373
"mermaid-format": {
25351-
_internalId: 221794,
25374+
_internalId: 222598,
2535225375
type: "enum",
2535325376
enum: [
2535425377
"png",
@@ -25364,7 +25387,7 @@ var require_yaml_intelligence_resources = __commonJS({
2536425387
exhaustiveCompletions: true
2536525388
},
2536625389
theme: {
25367-
_internalId: 221801,
25390+
_internalId: 222605,
2536825391
type: "anyOf",
2536925392
anyOf: [
2537025393
{

src/resources/editor/tools/yaml/all-schema-definitions.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)