confluence-cli 1.33.1 → 1.33.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/lib/config.js CHANGED
@@ -235,7 +235,9 @@ function readConfigFile() {
235
235
  }
236
236
 
237
237
  return raw;
238
- } catch {
238
+ } catch (error) {
239
+ console.error(chalk.yellow(`⚠ Failed to parse config file at ${CONFIG_FILE}: ${error.message}`));
240
+ console.error(chalk.yellow(' Run "confluence init" to recreate it.'));
239
241
  return null;
240
242
  }
241
243
  }
@@ -259,7 +261,7 @@ const validateCliOptions = (options) => {
259
261
  errors.push('--domain cannot be empty');
260
262
  }
261
263
 
262
- if (options.token !== undefined && !options.token.trim()) {
264
+ if (options.token !== undefined && (typeof options.token !== 'string' || !options.token.trim())) {
263
265
  errors.push('--token cannot be empty');
264
266
  }
265
267
 
@@ -304,7 +306,7 @@ const validateCliOptions = (options) => {
304
306
  }
305
307
  }
306
308
 
307
- if (normAuthType === 'cookie' && options.cookie !== undefined && !options.cookie.trim()) {
309
+ if (normAuthType === 'cookie' && options.cookie !== undefined && (typeof options.cookie !== 'string' || !options.cookie.trim())) {
308
310
  errors.push('--cookie cannot be empty when using cookie authentication');
309
311
  }
310
312
 
@@ -22,6 +22,14 @@ function htmlToMarkdown(html) {
22
22
 
23
23
  markdown = markdown.replace(/<time\s+datetime="([^"]+)"[^>]*(?:\/>|>\s*<\/time>)/g, '$1');
24
24
 
25
+ // Convert <a href="url">text</a> to [text](url) before generic attribute stripping.
26
+ // Allows attributes anywhere in the opening tag so smart links / inline cards
27
+ // (e.g. <a href="..." data-card-appearance="inline">) are preserved.
28
+ markdown = markdown.replace(
29
+ /<a\s+[^>]*?href="([^"]*)"[^>]*>([\s\S]*?)<\/a>/g,
30
+ (_, href, text) => `[${text}](${href})`
31
+ );
32
+
25
33
  markdown = markdown.replace(/<strong[^>]*>(.*?)<\/strong>/g, '**$1**');
26
34
 
27
35
  markdown = markdown.replace(/<em[^>]*>(.*?)<\/em>/g, '*$1*');
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "confluence-cli",
3
- "version": "1.33.1",
3
+ "version": "1.33.3",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "confluence-cli",
9
- "version": "1.33.1",
9
+ "version": "1.33.3",
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": "1.33.1",
3
+ "version": "1.33.3",
4
4
  "description": "A command-line interface for Atlassian Confluence with page creation and editing capabilities",
5
5
  "main": "index.js",
6
6
  "bin": {