ironmark 1.11.0 → 1.11.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ironmark",
3
- "version": "1.11.0",
3
+ "version": "1.11.2",
4
4
  "description": "Very fast markdown parser in Rust, consumable from JavaScript/TypeScript via WebAssembly",
5
5
  "keywords": [
6
6
  "markdown",
package/wasm/cli.js CHANGED
@@ -18,6 +18,7 @@ OPTIONS:
18
18
  --width N Terminal column width (default: auto-detect, fallback 80)
19
19
  --no-color Disable ANSI escape codes (plain text)
20
20
  -n, --line-numbers Show line numbers in fenced code blocks
21
+ --padding N Horizontal padding on both sides of output (default: 0)
21
22
  --no-hard-breaks Don't turn soft newlines into hard line breaks
22
23
  --no-tables Disable pipe table syntax
23
24
  --no-highlight Disable ==highlight== syntax
@@ -76,6 +77,15 @@ for (let i = 0; i < args.length; i++) {
76
77
  ansiOptions.width = Number(val);
77
78
  break;
78
79
  }
80
+ case "--padding": {
81
+ const val = args[++i];
82
+ if (val === undefined || Number.isNaN(Number(val))) {
83
+ console.error("error: --padding requires a numeric value");
84
+ process.exit(2);
85
+ }
86
+ ansiOptions.padding = Number(val);
87
+ break;
88
+ }
79
89
  case "--no-hard-breaks":
80
90
  parseOptions.hardBreaks = false;
81
91
  break;
@@ -111,6 +121,13 @@ for (let i = 0; i < args.length; i++) {
111
121
  process.exit(2);
112
122
  }
113
123
  ansiOptions.width = val;
124
+ } else if (args[i].startsWith("--padding=")) {
125
+ const val = Number(args[i].slice("--padding=".length));
126
+ if (Number.isNaN(val)) {
127
+ console.error("error: --padding requires a numeric value");
128
+ process.exit(2);
129
+ }
130
+ ansiOptions.padding = val;
114
131
  } else if (args[i].startsWith("-") && args[i] !== "-") {
115
132
  console.error(`error: unknown flag: ${args[i]}`);
116
133
  console.error("Run 'ironmark --help' for usage.");
package/wasm/index.d.ts CHANGED
@@ -86,6 +86,12 @@ export interface AnsiOptions {
86
86
  * count and separated from the code by a `│` border. Default: `false`.
87
87
  */
88
88
  lineNumbers?: boolean;
89
+ /**
90
+ * Horizontal padding to add on both sides of every output line.
91
+ * The output width remains `width`; padding reduces the available text area.
92
+ * Also adds `ceil(padding / 2)` blank lines at the top. Default: `0`.
93
+ */
94
+ padding?: number;
89
95
  }
90
96
 
91
97
  /**