confluence-cli 2.1.10 → 2.1.11

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.
@@ -250,9 +250,9 @@ class StorageWalker {
250
250
 
251
251
  handleExpand(node) {
252
252
  const titleParam = this.findParamByName(node, 'title');
253
+ const title = (titleParam ? this.getTextContent(titleParam) : '').trim();
253
254
  const body = this.getMacroBody(node);
254
- if (titleParam) {
255
- const title = this.getTextContent(titleParam);
255
+ if (title) {
256
256
  return `\n**EXPAND: ${title}**\n\n${this.walkNodes(body).trim()}\n\n**EXPAND_END**\n`;
257
257
  }
258
258
  return `\n<details>\n<summary>${this.labels.expandDetails || 'Expand Details'}</summary>\n\n${this.walkNodes(body).trim()}\n\n</details>\n`;
@@ -328,7 +328,7 @@ class StorageWalker {
328
328
 
329
329
  handleSharedBlock(node, type) {
330
330
  const blockKeyParam = this.findParamByName(node, 'shared-block-key');
331
- const blockKey = blockKeyParam ? this.getTextContent(blockKeyParam) : '';
331
+ const blockKey = (blockKeyParam ? this.getTextContent(blockKeyParam) : '').trim();
332
332
  const pageParam = this.findParamByName(node, 'page');
333
333
  if (pageParam && type === 'include-shared-block') {
334
334
  const acLink = this.findChildByName(pageParam, 'ac:link');
@@ -338,7 +338,8 @@ class StorageWalker {
338
338
  const pageTitle = this.escapeMarkdownText(decodeEntities(riPage.attribs['ri:content-title'] || ''));
339
339
  const includeLabel = this.labels.includeSharedBlock || 'Include Shared Block';
340
340
  const fromPageLabel = this.labels.fromPage || 'from page';
341
- return `\n> 📄 **${includeLabel}**: ${blockKey} (${fromPageLabel}: ${pageTitle} [link needs manual correction])\n`;
341
+ const keyPart = blockKey ? `: ${blockKey} ` : ' ';
342
+ return `\n> 📄 **${includeLabel}**${keyPart}(${fromPageLabel}: ${pageTitle} [link needs manual correction])\n`;
342
343
  }
343
344
  }
344
345
  }
@@ -346,8 +347,11 @@ class StorageWalker {
346
347
  // See handlePanel — trim to avoid bracketing `>` blank lines.
347
348
  const cleanContent = this.walkNodes(body).trim();
348
349
  const sharedLabel = this.labels.sharedBlock || 'Shared Block';
350
+ if (!blockKey && !cleanContent) return '';
351
+ const header = blockKey ? `**${sharedLabel}: ${blockKey}**` : `**${sharedLabel}**`;
352
+ if (!cleanContent) return `\n> ${header}\n`;
349
353
  const quoted = cleanContent.split('\n').map((line) => (line ? `> ${line}` : '>')).join('\n');
350
- return `\n> **${sharedLabel}: ${blockKey}**\n>\n${quoted}\n`;
354
+ return `\n> ${header}\n>\n${quoted}\n`;
351
355
  }
352
356
 
353
357
  handleViewFile(node) {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "confluence-cli",
3
- "version": "2.1.10",
3
+ "version": "2.1.11",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "confluence-cli",
9
- "version": "2.1.10",
9
+ "version": "2.1.11",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "axios": "^1.15.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "confluence-cli",
3
- "version": "2.1.10",
3
+ "version": "2.1.11",
4
4
  "description": "A command-line interface for Atlassian Confluence with page creation and editing capabilities",
5
5
  "main": "index.js",
6
6
  "bin": {