@seed-hypermedia/client 0.0.21 → 0.0.23
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.
|
@@ -1149,8 +1149,7 @@ function unpackHmId(hypermediaId) {
|
|
|
1149
1149
|
}
|
|
1150
1150
|
const version = parsed.query.v || null;
|
|
1151
1151
|
const fragment = parseFragment(parsed.fragment);
|
|
1152
|
-
const
|
|
1153
|
-
const latest = hasBlockRef ? false : parsed.query.l === null || parsed.query.l === "" || !version;
|
|
1152
|
+
const latest = parsed.query.l === null || parsed.query.l === "" || !version;
|
|
1154
1153
|
let blockRange = null;
|
|
1155
1154
|
if (fragment) {
|
|
1156
1155
|
if ("start" in fragment) {
|
package/dist/hm-types.mjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
serializeBlockRange,
|
|
17
17
|
toNumber,
|
|
18
18
|
unpackHmId
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-KDTQQR2L.mjs";
|
|
20
20
|
|
|
21
21
|
// src/capability.ts
|
|
22
22
|
import { encode as cborEncode2 } from "@ipld/dag-cbor";
|
|
@@ -2261,6 +2261,24 @@ function parseInlineFormatting(raw) {
|
|
|
2261
2261
|
}
|
|
2262
2262
|
}
|
|
2263
2263
|
}
|
|
2264
|
+
if (raw[i] === "<") {
|
|
2265
|
+
const end = raw.indexOf(">", i + 1);
|
|
2266
|
+
if (end !== -1) {
|
|
2267
|
+
const inner = raw.slice(i + 1, end);
|
|
2268
|
+
if (/^[a-zA-Z][a-zA-Z0-9+.-]*:\S*$/.test(inner) && !/[\s<>]/.test(inner)) {
|
|
2269
|
+
const start = text.length;
|
|
2270
|
+
text += "\uFFFC";
|
|
2271
|
+
annotations.push({
|
|
2272
|
+
type: "Embed",
|
|
2273
|
+
starts: [start],
|
|
2274
|
+
ends: [text.length],
|
|
2275
|
+
link: inner
|
|
2276
|
+
});
|
|
2277
|
+
i = end + 1;
|
|
2278
|
+
continue;
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2264
2282
|
if (raw[i] === "[") {
|
|
2265
2283
|
const closeBracket = findClosingBracket(raw, i);
|
|
2266
2284
|
if (closeBracket !== -1 && closeBracket + 1 < raw.length && raw[closeBracket + 1] === "(") {
|
|
@@ -2830,7 +2848,7 @@ function blockNodeToMarkdown(node, depth, opts) {
|
|
|
2830
2848
|
} else if (childrenType === "Blockquote") {
|
|
2831
2849
|
result += "\n" + indent(depth + 1) + "> " + childMd.trim();
|
|
2832
2850
|
} else {
|
|
2833
|
-
result += "\n" + childMd;
|
|
2851
|
+
result += "\n\n" + childMd;
|
|
2834
2852
|
}
|
|
2835
2853
|
}
|
|
2836
2854
|
}
|
|
@@ -2950,12 +2968,7 @@ function getAnnotationMarker(ann, type) {
|
|
|
2950
2968
|
}
|
|
2951
2969
|
case "Embed": {
|
|
2952
2970
|
const link = "link" in ann ? ann.link || "" : "";
|
|
2953
|
-
|
|
2954
|
-
const pathPart = link.includes("/") ? link.split("/").pop() || "embed" : link.replace("hm://", "").slice(0, 12);
|
|
2955
|
-
return `[\u2197 ${pathPart}`;
|
|
2956
|
-
} else {
|
|
2957
|
-
return `](${link})`;
|
|
2958
|
-
}
|
|
2971
|
+
return type === "open" ? `<${link}` : ">";
|
|
2959
2972
|
}
|
|
2960
2973
|
default:
|
|
2961
2974
|
return "";
|