Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/tests/smoke/crossref/options.test.ts
12921 views
1
/*
2
* options.test.ts
3
*
4
* Copyright (C) 2020-2022 Posit Software, PBC
5
*
6
*/
7
8
import { ensureFileRegexMatches, ensureHtmlElements } from "../../verify.ts";
9
import { testRender } from "../render/render.ts";
10
import { crossref } from "./utils.ts";
11
12
const optionsQmd = crossref("options.qmd", "html");
13
testRender(optionsQmd.input, "html", false, [
14
ensureHtmlElements(optionsQmd.output.outputPath, [], [
15
"section#introduction p a",
16
"section#introduction div#tbl-letters p a",
17
]),
18
ensureFileRegexMatches(optionsQmd.output.outputPath, [
19
/F\. 1/,
20
/T\. 1/,
21
/Figure 1— Elephant/,
22
/Table 1— My Caption/,
23
], [
24
/\?@fig-/,
25
/\?@tbl-/,
26
]),
27
]);
28
29
const numberingQmd = crossref("numbering.qmd", "html");
30
testRender(numberingQmd.input, "html", false, [
31
ensureFileRegexMatches(numberingQmd.output.outputPath, [
32
/Figure x/,
33
/Table A/,
34
/Figure x: Elephant/,
35
/Table A: My Caption/,
36
/Figure y: Famous Elephants/,
37
/\(i\) Surus/,
38
/\(ii\) Abbas/,
39
], [
40
/\?@fig-/,
41
/\?@tbl-/,
42
]),
43
]);
44
45