applesauce-content 0.0.0-next-20250312111321 → 0.0.0-next-20250312152821

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.
@@ -0,0 +1,3 @@
1
+ import { Transformer } from "unified";
2
+ import { Root } from "../nast/types.js";
3
+ export declare function links(): Transformer<Root>;
@@ -0,0 +1,22 @@
1
+ import Expressions from "../helpers/regexp.js";
2
+ import { findAndReplace } from "../nast/find-and-replace.js";
3
+ export function links() {
4
+ return (tree) => {
5
+ findAndReplace(tree, [
6
+ [
7
+ Expressions.link,
8
+ (_) => {
9
+ try {
10
+ return {
11
+ type: "link",
12
+ href: new URL(_).toString(),
13
+ value: _,
14
+ };
15
+ }
16
+ catch (error) { }
17
+ return false;
18
+ },
19
+ ],
20
+ ]);
21
+ };
22
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "applesauce-content",
3
- "version": "0.0.0-next-20250312111321",
3
+ "version": "0.0.0-next-20250312152821",
4
4
  "description": "Unified plugins for processing event content",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -52,7 +52,7 @@
52
52
  "@types/hast": "^3.0.4",
53
53
  "@types/mdast": "^4.0.4",
54
54
  "@types/unist": "^3.0.3",
55
- "applesauce-core": "0.0.0-next-20250312111321",
55
+ "applesauce-core": "0.0.0-next-20250312152821",
56
56
  "mdast-util-find-and-replace": "^3.0.2",
57
57
  "nostr-tools": "^2.10.4",
58
58
  "remark": "^15.0.1",