Skip to content

Commit 814da3a

Browse files
authored
Merge branch 'main' into gha/cache-update
2 parents 4da4f48 + a0ff13f commit 814da3a

File tree

6 files changed

+42
-36
lines changed

6 files changed

+42
-36
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
You can contribute to Quarto in many ways:
44

55
- By opening issues to provide feedback and share ideas.
6-
- By submitting Pull Request (PR) to fix opened issues
6+
- By submitting Pull Request (PR) to fix open issues
77
- By submitting Pull Request (PR) to suggest new features (it is considered good practice to open an issue for discussion before working on a pull request for a new feature).
88

99
Please be mindful of our [code of conduct](https://github.com/quarto-dev/quarto-cli/blob/main/.github/CODE_OF_CONDUCT.md) as you interact with other community members.
@@ -26,8 +26,8 @@ Pull requests are very welcome! Here's how to contribute via PR:
2626
$ git checkout -b feature/newthing
2727
```
2828

29-
2. For significant changes (e.g more than small bug fixes), ensure that you have signed the [individual](https://posit.co/wp-content/uploads/2023/04/2023-03-13_TC_Indiv_contrib_agreement.pdf) or [corporate](https://posit.co/wp-content/uploads/2023/04/2023-03-13_TC_Corp_contrib_agreement.pdf) contributor agreement as appropriate. You can send the signed copy to [jj\@rstudio.com](mailto:[email protected]){.email}.
29+
2. For significant changes (e.g., more than small bug fixes), ensure that you have signed the [individual](https://posit.co/wp-content/uploads/2023/04/2023-03-13_TC_Indiv_contrib_agreement.pdf) or [corporate](https://posit.co/wp-content/uploads/2023/04/2023-03-13_TC_Corp_contrib_agreement.pdf) contributor agreement as appropriate. You can send the signed copy to [jj\@rstudio.com](mailto:[email protected]){.email}.
3030

31-
3. Submit the [pull request](https://help.github.com/articles/using-pull-requests). It is ok to submit as draft in your are still working on it but would like some feedback from us. It always good to share in the open that you are working on it.
31+
3. Submit the [pull request](https://help.github.com/articles/using-pull-requests). It is ok to submit as draft if your are still working on it but would like some feedback from us. It is always good to share in the open that you are working on it.
3232

3333
We'll try to be as responsive as possible in reviewing and accepting pull requests.

src/core/markdown-pipeline.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
*
44
* Copyright (C) 2020-2022 Posit Software, PBC
55
*/
6-
import { base } from "acorn/walk";
76
import { decodeBase64, encodeBase64 } from "encoding/base64";
87
import { Document, Element, Node } from "./deno-dom.ts";
9-
import { decode } from "https://deno.land/[email protected]/encoding/base64.ts";
108

119
export interface PipelineMarkdown {
1210
blocks?: Record<string, string>;

src/resources/filters/main.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,12 @@ local quarto_pre_filters = {
296296
traverser = 'jog',
297297
},
298298

299+
{ name = "strip-notes-from-hidden",
300+
filter = strip_notes_from_hidden(),
301+
flags = { "has_notes" },
302+
traverser = 'jog',
303+
},
304+
299305
{ name = "pre-combined-hidden",
300306
filter = combineFilters({
301307
hidden(),

src/resources/filters/normalize/flags.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ function compute_flags()
178178
end,
179179
Figure = function(node)
180180
flags.has_pandoc3_figure = true
181-
end
181+
end,
182+
Note = function(node)
183+
flags.has_notes = true
184+
end,
182185
}, {
183186
Meta = function(el)
184187
local lightbox_auto = lightbox_module.automatic(el)

src/resources/filters/normalize/normalize.lua

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,6 @@ local authors = require 'modules/authors'
2020
local license = require 'modules/license'
2121
local shortcode_ast = require 'modules/astshortcode'
2222

23-
local function stripNotes(el)
24-
local result = _quarto.ast.walk(el, {
25-
Note = function(_el)
26-
return pandoc.Null()
27-
end
28-
})
29-
return result
30-
end
31-
3223
function normalize_filter()
3324
return {
3425
Meta = function(meta)
@@ -59,22 +50,6 @@ function normalize_filter()
5950
normalized = shortcode_ast.parse(normalized)
6051

6152
return normalized
62-
end,
63-
Div = function(div)
64-
-- Don't allow footnotes in the hidden element (markdown pipeline)
65-
-- since that will result in duplicate footnotes
66-
-- in the rendered output
67-
if div.classes:includes('hidden') then
68-
return stripNotes(div)
69-
end
70-
end,
71-
Span = function(span)
72-
-- Don't allow footnotes in the hidden element (markdown pipeline)
73-
-- since that will result in duplicate footnotes
74-
-- in the rendered output
75-
if span.classes:includes('hidden') then
76-
return stripNotes(span)
77-
end
7853
end
7954
}
8055
end

src/resources/filters/quarto-pre/hidden.lua

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,32 @@ function hidden()
8181
end
8282
end
8383

84-
85-
86-
87-
88-
84+
function strip_notes_from_hidden()
85+
local function stripNotes(el)
86+
local result = _quarto.ast.walk(el, {
87+
Note = function(_el)
88+
return pandoc.Null()
89+
end
90+
})
91+
return result
92+
end
93+
94+
return {
95+
Div = function(div)
96+
-- Don't allow footnotes in the hidden element (markdown pipeline)
97+
-- since that will result in duplicate footnotes
98+
-- in the rendered output
99+
if div.classes:includes('hidden') then
100+
return stripNotes(div)
101+
end
102+
end,
103+
Span = function(span)
104+
-- Don't allow footnotes in the hidden element (markdown pipeline)
105+
-- since that will result in duplicate footnotes
106+
-- in the rendered output
107+
if span.classes:includes('hidden') then
108+
return stripNotes(span)
109+
end
110+
end
111+
}
112+
end

0 commit comments

Comments
 (0)