@uniweb/content-reader 1.0.6 → 1.0.7

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": "@uniweb/content-reader",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Markdown to ProseMirror document structure converter",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -148,16 +148,16 @@ function parseInline(token, schema, removeNewLine = false) {
148
148
  if (token.type === "image") {
149
149
  let role, src, iconLibrary, iconName;
150
150
 
151
- // Check for icon protocol prefixes (lucide:, heroicons:, etc.)
152
- const iconMatch = token.href.match(/^(lucide|heroicons|phosphor|tabler|feather|icon):(.+)$/);
151
+ // Check for icon library prefixes (lucide:, heroicons:, etc.)
152
+ // Note: 'icon:' is NOT included here - it's a role prefix, not a library
153
+ const iconMatch = token.href.match(/^(lucide|heroicons|phosphor|tabler|feather):(.+)$/);
153
154
  if (iconMatch) {
154
155
  iconLibrary = iconMatch[1];
155
156
  iconName = iconMatch[2];
156
157
  role = "icon";
157
- // For known icon libraries, use the name; for generic 'icon:', use as URL
158
- src = iconLibrary === "icon" ? iconName : null;
158
+ src = null; // Named icons don't have a src URL
159
159
  }
160
- // Find the first colon to handle role:url format correctly (legacy syntax)
160
+ // Find the first colon to handle role:url format correctly (e.g., icon:path/to/file.svg)
161
161
  else if (token.href.includes(":") && !token.href.startsWith("http")) {
162
162
  const colonIndex = token.href.indexOf(":");
163
163
  role = token.href.substring(0, colonIndex);