pantsdown 2.2.3 → 2.2.5

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/.oxfmtrc.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "./node_modules/oxfmt/configuration_schema.json",
3
+ "ignorePatterns": [".github"],
4
+ "printWidth": 100,
5
+ "tabWidth": 3,
6
+ "sortImports": {
7
+ "newlinesBetween": false
8
+ },
9
+ "overrides": [
10
+ {
11
+ "files": ["*.json", "*.md"],
12
+ "options": {
13
+ "tabWidth": 2
14
+ }
15
+ }
16
+ ]
17
+ }
package/CLAUDE.md CHANGED
@@ -64,6 +64,7 @@ All token types are defined in `src/types.ts`. The `Token` union type covers all
64
64
  ## Output
65
65
 
66
66
  `pantsdown.parse(markdown)` returns `{ html, javascript }`:
67
+
67
68
  - `html`: The rendered HTML string
68
69
  - `javascript`: A script for interactive features (task list checkboxes, copy buttons)
69
70
 
package/README.md CHANGED
@@ -105,32 +105,50 @@ import { Pantsdown, type PartialPantsdownConfig } from "pantsdown";
105
105
  // This is the default config object. If you provide
106
106
  // a config object, it will be deeply merged into this.
107
107
  const config: PartialPantsdownConfig = {
108
- renderer: {
109
- /**
110
- * Prefix to be added to relative image sources.
111
- * Must start and end with "/"
112
- *
113
- * @example
114
- * relativeImageUrlPrefix: "/__localimage__/"
115
- *
116
- * ![image](./wallpants-512.png)
117
- * relative src is updated and results in:
118
- * <img src="/__localimage__/wallpants-512.png" />
119
- *
120
- * ![image](https://avatars.githubusercontent.com/wallpants)
121
- * absolute src remains unchanged:
122
- * <img src="https://avatars.githubusercontent.com/wallpants" />
123
- */
124
- relativeImageUrlPrefix: "",
125
-
126
- /**
127
- * Whether to render <details> html tags with attribute open=""
128
- *
129
- * @default
130
- * false
131
- */
132
- detailsTagDefaultOpen: false,
133
- },
108
+ renderer: {
109
+ /**
110
+ * Prefix to be added to relative image sources.
111
+ * Must start and end with "/"
112
+ *
113
+ * @example
114
+ * relativeImageUrlPrefix: "/__localimage__/nested/directory/"
115
+ *
116
+ * ![image](./wallpants-512.png)
117
+ * relative src is updated and results in:
118
+ * <img src="/__localimage__/nested/directory/wallpants-512.png" />
119
+ *
120
+ * ![image](https://avatars.githubusercontent.com/wallpants)
121
+ * absolute src remains unchanged:
122
+ * <img src="https://avatars.githubusercontent.com/wallpants" />
123
+ */
124
+ relativeImageUrlPrefix: string;
125
+
126
+ /**
127
+ * Prefix to be added to absolute image sources.
128
+ * Must start and end with "/"
129
+ * Falls back to `relativeImageUrlPrefix` if not provided
130
+ *
131
+ * @example
132
+ * absoluteImageUrlPrefix: "/__localimage__/"
133
+ *
134
+ * ![image](/wallpants-512.png)
135
+ * relative src is updated and results in:
136
+ * <img src="/__localimage__/wallpants-512.png" />
137
+ *
138
+ * ![image](https://avatars.githubusercontent.com/wallpants)
139
+ * external src remains unchanged:
140
+ * <img src="https://avatars.githubusercontent.com/wallpants" />
141
+ */
142
+ absoluteImageUrlPrefix?: string | undefined;
143
+
144
+ /**
145
+ * Whether to render <details> html tags with attribute `open=""`
146
+ *
147
+ * @default
148
+ * false
149
+ */
150
+ detailsTagDefaultOpen: boolean;
151
+ };
134
152
  };
135
153
 
136
154
  const pantsdown = new Pantsdown(config);