@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 +1 -1
- package/src/parser/inline.js +5 -5
package/package.json
CHANGED
package/src/parser/inline.js
CHANGED
|
@@ -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
|
|
152
|
-
|
|
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
|
-
|
|
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 (
|
|
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);
|