@quarto/jupyterlab-quarto 0.2.8 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/plugins/yaml.js +16 -5
- package/lib/providers/math.js +10 -4
- package/package.json +1 -1
package/lib/plugins/yaml.js
CHANGED
@@ -147,7 +147,16 @@ function renderFrontMatter(tokens, idx) {
|
|
147
147
|
}
|
148
148
|
};
|
149
149
|
// Read simple values
|
150
|
-
const eatKeys = [
|
150
|
+
const eatKeys = [
|
151
|
+
'title',
|
152
|
+
'subtitle',
|
153
|
+
'abstract',
|
154
|
+
'date',
|
155
|
+
'date-modified',
|
156
|
+
'doi',
|
157
|
+
'author',
|
158
|
+
'authors'
|
159
|
+
];
|
151
160
|
titleBlock.title = readStr('title');
|
152
161
|
titleBlock.subtitle = readStr('subtitle');
|
153
162
|
titleBlock.abstract = readStr('abstract');
|
@@ -171,9 +180,11 @@ function renderFrontMatter(tokens, idx) {
|
|
171
180
|
// Use the raw YAML string so we don't end up mutating / round tripping the YAML
|
172
181
|
let eating = false;
|
173
182
|
const outputYaml = [];
|
174
|
-
const yamlNoDelimiters = token.markup
|
175
|
-
|
176
|
-
|
183
|
+
const yamlNoDelimiters = token.markup
|
184
|
+
.replace(/---\s*$/, '')
|
185
|
+
.replace(/^---\s*/, '');
|
186
|
+
for (const line of yamlNoDelimiters.split('\n')) {
|
187
|
+
const eatKey = eatKeys.some(k => {
|
177
188
|
const match = line.match(RegExp(`^${k}\\s*:`));
|
178
189
|
return match !== null;
|
179
190
|
});
|
@@ -187,7 +198,7 @@ function renderFrontMatter(tokens, idx) {
|
|
187
198
|
}
|
188
199
|
}
|
189
200
|
}
|
190
|
-
const otherYamlRendered = `<pre class="quarto-frontmatter-container"><code class="cm-s-jupyter language-yaml quarto-frontmatter">${outputYaml.join(
|
201
|
+
const otherYamlRendered = `<pre class="quarto-frontmatter-container"><code class="cm-s-jupyter language-yaml quarto-frontmatter">${outputYaml.join('\n')}</code></pre>`;
|
191
202
|
titleLines.push(otherYamlRendered);
|
192
203
|
}
|
193
204
|
return titleLines.join('\n');
|
package/lib/providers/math.js
CHANGED
@@ -61,16 +61,22 @@ MathJax = {
|
|
61
61
|
});
|
62
62
|
|
63
63
|
const markdownNodes = nodes.filter((node) => {
|
64
|
-
return node.
|
64
|
+
return node.classList.contains("jp-MarkdownCell");
|
65
65
|
}).forEach((node) => {
|
66
66
|
typesetCellObserver.observe(node, { childList: true, subtree: true });
|
67
67
|
});
|
68
68
|
|
69
69
|
});
|
70
70
|
|
71
|
-
const
|
72
|
-
if (
|
73
|
-
|
71
|
+
const cellEl = document.querySelector('.jp-Cell');
|
72
|
+
if (cellEl !== null) {
|
73
|
+
const cellParentEl = cellEl.parentElement;
|
74
|
+
containerObserver.observe(cellParentEl, { childList: true });
|
75
|
+
} else {
|
76
|
+
const nbContainer = document.querySelector('.jp-Notebook');
|
77
|
+
if (nbContainer !== null) {
|
78
|
+
containerObserver.observe(nbContainer, { childList: true, subtree: true });
|
79
|
+
}
|
74
80
|
}
|
75
81
|
|
76
82
|
const mathEls = document.body.querySelectorAll('.quarto-inline-math, .quarto-display-math');
|