diff --git a/news/changelog-1.5.md b/news/changelog-1.5.md index 2e433b5013..a022444f9d 100644 --- a/news/changelog-1.5.md +++ b/news/changelog-1.5.md @@ -20,6 +20,7 @@ All changes included in 1.5: ## RevealJS Format - ([#8382](https://github.com/quarto-dev/quarto-cli/issues/8382)): Strip whitespace from `div.columns` elements that might have been introduced by third-party processing. +- ([#9117](https://github.com/quarto-dev/quarto-cli/issues/9117)): Fix an issue with input filename containing special characters. ## Docusaurus Format diff --git a/src/format/reveal/format-reveal-theme.ts b/src/format/reveal/format-reveal-theme.ts index 5458e2bb0b..abf2048ffa 100644 --- a/src/format/reveal/format-reveal-theme.ts +++ b/src/format/reveal/format-reveal-theme.ts @@ -37,6 +37,7 @@ import { copyMinimal, copyTo } from "../../core/copy.ts"; import { titleSlideScss } from "./format-reveal-title.ts"; import { asCssFont, asCssNumber } from "../../core/css.ts"; import { cssHasDarkModeSentinel } from "../../core/pandoc/css.ts"; +import { pandocNativeStr } from "../../core/pandoc/codegen.ts"; export const kRevealLightThemes = [ "white", @@ -82,7 +83,9 @@ export async function revealTheme( // compute reveal url const revealUrl = pathWithForwardSlashes(revealDir); - metadata[kRevealJsUrl] = revealUrl; + // escape to avoid pandoc markdown parsing from YAML default file + // https://github.com/quarto-dev/quarto-cli/issues/9117 + metadata[kRevealJsUrl] = pandocNativeStr(revealUrl).mappedString().value; // copy reveal dir const revealSrcDir = revealJsUrl || diff --git a/src/format/reveal/format-reveal.ts b/src/format/reveal/format-reveal.ts index a31e1d1189..c55fb9af0e 100644 --- a/src/format/reveal/format-reveal.ts +++ b/src/format/reveal/format-reveal.ts @@ -68,6 +68,7 @@ import { revealMetadataFilter } from "./metadata.ts"; import { ProjectContext } from "../../project/types.ts"; import { titleSlidePartial } from "./format-reveal-title.ts"; import { registerWriterFormatHandler } from "../format-handlers.ts"; +import { pandocNativeStr } from "../../core/pandoc/codegen.ts"; export function revealResolveFormat(format: Format) { format.metadata = revealMetadataFilter(format.metadata); @@ -211,7 +212,9 @@ export function revealjsFormat() { [kLinkCitations]: true, [kRevealJsScripts]: revealPluginData.pluginInit.scripts.map( (script) => { - return script.path; + // escape to avoid pandoc markdown parsing from YAML default file + // https://github.com/quarto-dev/quarto-cli/issues/9117 + return pandocNativeStr(script.path).mappedString().value; }, ), } as Metadata, diff --git a/tests/docs/smoke-all/2024/03/27/9117--issue.qmd b/tests/docs/smoke-all/2024/03/27/9117--issue.qmd new file mode 100644 index 0000000000..e71e7c7b11 --- /dev/null +++ b/tests/docs/smoke-all/2024/03/27/9117--issue.qmd @@ -0,0 +1,11 @@ +--- +format: revealjs +_quarto: + tests: + revealjs: + ensureHtmlElements: + - ['*[src ^= "9117--issue_files/"', '*[href ^= "9117--issue_files/"'] + - ['*[src ^= "9117–issue_files/"', '*[href ^= "9117–issue_files/"'] +--- + +a little test \ No newline at end of file