@seed-hypermedia/client 0.0.22 → 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.
Files changed (2) hide show
  1. package/dist/index.mjs +20 -7
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -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
- if (type === "open") {
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 "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-hypermedia/client",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/seed-hypermedia/seed",