confluence-cli 2.1.2 → 2.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/macro-converter.js +28 -14
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -789,7 +789,7 @@ A blockquote whose first line is `**INFO**`, `**WARNING**`, or `**NOTE**` become
|
|
|
789
789
|
> Side note for the reader.
|
|
790
790
|
```
|
|
791
791
|
|
|
792
|
-
The reverse direction emits the
|
|
792
|
+
The reverse direction emits the same `> **INFO**` / `> **WARNING**` / `> **NOTE**` blockquote form, so multi-paragraph bodies round-trip cleanly. The bare `[!info]` / `[!warning]` / `[!note]` shorthand is still accepted on input for backwards compatibility.
|
|
793
793
|
|
|
794
794
|
A blockquote without one of these markers stays a **plain blockquote** (`<blockquote>…</blockquote>`) — `> …` is treated as a quotation, not an alert. Use the markers above when you want a callout.
|
|
795
795
|
|
package/lib/macro-converter.js
CHANGED
|
@@ -294,20 +294,34 @@ class MacroConverter {
|
|
|
294
294
|
return `\n\`\`\`\n${code}\n\`\`\`\n`;
|
|
295
295
|
});
|
|
296
296
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
297
|
+
// Emit the README-recommended `> **MARKER**` blockquote form rather than
|
|
298
|
+
// the bare `[!marker]` shorthand. The bare form has no explicit body
|
|
299
|
+
// terminator, so a blank line inside a multi-paragraph body is
|
|
300
|
+
// indistinguishable from the body ending — round-tripping such a body
|
|
301
|
+
// through markdownToStorage drops every paragraph after the first.
|
|
302
|
+
// The `>` prefix gives the blockquote-based handler an unambiguous body
|
|
303
|
+
// boundary, so multi-paragraph callouts survive download → re-upload.
|
|
304
|
+
// markdownToStorage still accepts the bare `[!marker]` form on input for
|
|
305
|
+
// backwards compatibility with already-downloaded files.
|
|
306
|
+
//
|
|
307
|
+
// Wrap the output with leading + trailing `\n` to combine with the single
|
|
308
|
+
// `\n` that htmlToMarkdown emits around adjacent `<p>` tags. Without
|
|
309
|
+
// these, a following `<p>after</p>` lazy-continues into the blockquote
|
|
310
|
+
// body and lands inside the macro on re-upload (blockquote semantics —
|
|
311
|
+
// unlike code fences, blockquotes have no closing delimiter).
|
|
312
|
+
for (const marker of CALLOUT_MARKERS) {
|
|
313
|
+
const re = new RegExp(`<ac:structured-macro ac:name="${marker}"[^>]*>[\\s\\S]*?<ac:rich-text-body>([\\s\\S]*?)<\\/ac:rich-text-body>[\\s\\S]*?<\\/ac:structured-macro>`, 'g');
|
|
314
|
+
markdown = markdown.replace(re, (_, content) => {
|
|
315
|
+
const body = htmlToMarkdown(content).trim();
|
|
316
|
+
const quotedBody = body
|
|
317
|
+
.split('\n')
|
|
318
|
+
.map((line) => (line.length === 0 ? '>' : `> ${line}`))
|
|
319
|
+
.join('\n');
|
|
320
|
+
const header = `> **${marker.toUpperCase()}**`;
|
|
321
|
+
const inner = body.length === 0 ? header : `${header}\n${quotedBody}`;
|
|
322
|
+
return `\n${inner}\n`;
|
|
323
|
+
});
|
|
324
|
+
}
|
|
311
325
|
|
|
312
326
|
// anchor macro → **ANCHOR: id** marker (round-trip with markdownToStorage).
|
|
313
327
|
// Must run before the generic <ac:structured-macro> catch-all below, which
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "confluence-cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "confluence-cli",
|
|
9
|
-
"version": "2.1.
|
|
9
|
+
"version": "2.1.3",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"axios": "^1.15.0",
|