astro-intl 2.0.0 → 2.0.1
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.
|
@@ -19,7 +19,10 @@ describe("framework-base.ts", () => {
|
|
|
19
19
|
]);
|
|
20
20
|
});
|
|
21
21
|
it("should parse multiple tags", () => {
|
|
22
|
-
const result = parseRichSegments("Text with <bold>bold</bold> and <italic>italic</italic>", [
|
|
22
|
+
const result = parseRichSegments("Text with <bold>bold</bold> and <italic>italic</italic>", [
|
|
23
|
+
"bold",
|
|
24
|
+
"italic",
|
|
25
|
+
]);
|
|
23
26
|
expect(result).toEqual([
|
|
24
27
|
{ type: "text", value: "Text with " },
|
|
25
28
|
{ type: "tag", tag: "bold", chunks: "bold" },
|
|
@@ -28,10 +31,7 @@ describe("framework-base.ts", () => {
|
|
|
28
31
|
]);
|
|
29
32
|
});
|
|
30
33
|
it("should handle adjacent tags", () => {
|
|
31
|
-
const result = parseRichSegments("<tag1>First</tag1><tag2>Second</tag2>", [
|
|
32
|
-
"tag1",
|
|
33
|
-
"tag2",
|
|
34
|
-
]);
|
|
34
|
+
const result = parseRichSegments("<tag1>First</tag1><tag2>Second</tag2>", ["tag1", "tag2"]);
|
|
35
35
|
expect(result).toEqual([
|
|
36
36
|
{ type: "tag", tag: "tag1", chunks: "First" },
|
|
37
37
|
{ type: "tag", tag: "tag2", chunks: "Second" },
|
|
@@ -47,9 +47,7 @@ describe("framework-base.ts", () => {
|
|
|
47
47
|
});
|
|
48
48
|
it("should return text segment when no matching tags found", () => {
|
|
49
49
|
const result = parseRichSegments("Hello <unknown>world</unknown>", ["link"]);
|
|
50
|
-
expect(result).toEqual([
|
|
51
|
-
{ type: "text", value: "Hello <unknown>world</unknown>" },
|
|
52
|
-
]);
|
|
50
|
+
expect(result).toEqual([{ type: "text", value: "Hello <unknown>world</unknown>" }]);
|
|
53
51
|
});
|
|
54
52
|
it("should handle tag names with special regex characters", () => {
|
|
55
53
|
const result = parseRichSegments("Click <link.ext>here</link.ext> now", ["link.ext"]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro-intl",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Sistema de internacionalización simple y type-safe para Astro.",
|
|
6
6
|
"keywords": [
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
"internationalization",
|
|
13
13
|
"intl",
|
|
14
14
|
"translations",
|
|
15
|
-
"typescript"
|
|
15
|
+
"typescript",
|
|
16
|
+
"accessibility",
|
|
17
|
+
"a11y"
|
|
16
18
|
],
|
|
17
19
|
"author": "Erick Cruz <erickj.cruzs@gmail.com>",
|
|
18
20
|
"license": "MIT",
|