Skip to content

Commit

Permalink
Merge pull request #9221 from quarto-dev/fix/escape-revealjs-url
Browse files Browse the repository at this point in the history
  • Loading branch information
cderv authored Mar 29, 2024
2 parents be5951b + b94d1b5 commit d39cb2f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/changelog-1.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion src/format/reveal/format-reveal-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 ||
Expand Down
5 changes: 4 additions & 1 deletion src/format/reveal/format-reveal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down
11 changes: 11 additions & 0 deletions tests/docs/smoke-all/2024/03/27/9117--issue.qmd
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d39cb2f

Please sign in to comment.