-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'quarto-dev:main' into main
- Loading branch information
Showing
38 changed files
with
1,445 additions
and
1,076 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* is-circular.ts | ||
* | ||
* Copyright (C) 2025 Posit Software, PBC | ||
*/ | ||
|
||
// deno-lint-ignore no-explicit-any | ||
export const isCircular = (obj: any): unknown => { | ||
const objectSet = new WeakSet(); | ||
// deno-lint-ignore no-explicit-any | ||
const detect = (obj: any): boolean => { | ||
if (obj && typeof obj === "object") { | ||
if (objectSet.has(obj)) { | ||
return true; | ||
} | ||
objectSet.add(obj); | ||
for (const key in obj) { | ||
if (Object.hasOwn(obj, key) && detect(obj[key])) { | ||
return true; | ||
} | ||
} | ||
objectSet.delete(obj); | ||
} | ||
return false; | ||
}; | ||
return detect(obj); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* level-one-headings.ts | ||
* | ||
* Copyright (C) 2025 Posit Software, PBC | ||
*/ | ||
|
||
import { join } from "../../../deno_ral/path.ts"; | ||
import { execProcess } from "../../process.ts"; | ||
import { pandocBinaryPath, resourcePath } from "../../resources.ts"; | ||
|
||
export async function hasLevelOneHeadings(markdown: string): Promise<boolean> { | ||
// this is O(n * m) where n is the number of blocks and m is the number of matches | ||
// we could do better but won't until we profile and show it's a problem | ||
|
||
const path = pandocBinaryPath(); | ||
const filterPath = resourcePath( | ||
join("filters", "quarto-internals", "leveloneanalysis.lua"), | ||
); | ||
const result = await execProcess({ | ||
cmd: [path, "-f", "markdown", "-t", "markdown", "-L", filterPath], | ||
stdout: "piped", | ||
}, markdown); | ||
return result.stdout?.trim() === "true"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.