Skip to content

Commit 72266a6

Browse files
committed
Merge tag '1.6.9' into 1.7-maintenance
Fedify 1.6.9
2 parents c9c5b9e + 6beebf7 commit 72266a6

File tree

3 files changed

+110
-1
lines changed

3 files changed

+110
-1
lines changed

CHANGES.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ Version 1.7.10
88

99
To be released.
1010

11+
- Fixed a bug where ActivityPub Discovery failed to recognize XHTML
12+
self-closing `<link>` tags. The HTML/XHTML parser now correctly handles
13+
whitespace before the self-closing slash (`/>`), improving compatibility
14+
with XHTML documents that follow the self-closing tag format.
15+
1116

1217
Version 1.7.9
1318
-------------
@@ -146,6 +151,17 @@ Released on June 25, 2025.
146151
[#252]: https://github.com/fedify-dev/fedify/pull/252
147152

148153

154+
Version 1.6.9
155+
-------------
156+
157+
Released on August 25, 2025.
158+
159+
- Fixed a bug where ActivityPub Discovery failed to recognize XHTML
160+
self-closing `<link>` tags. The HTML/XHTML parser now correctly handles
161+
whitespace before the self-closing slash (`/>`), improving compatibility
162+
with XHTML documents that follow the self-closing tag format.
163+
164+
149165
Version 1.6.8
150166
-------------
151167

@@ -287,6 +303,17 @@ the versioning.
287303
[#242]: https://github.com/fedify-dev/fedify/pull/242
288304

289305

306+
Version 1.5.6
307+
-------------
308+
309+
Released on August 25, 2025.
310+
311+
- Fixed a bug where ActivityPub Discovery failed to recognize XHTML
312+
self-closing `<link>` tags. The HTML/XHTML parser now correctly handles
313+
whitespace before the self-closing slash (`/>`), improving compatibility
314+
with XHTML documents that follow the self-closing tag format.
315+
316+
290317
Version 1.5.5
291318
-------------
292319

@@ -474,6 +501,17 @@ Released on March 28, 2025.
474501
[multibase]: https://github.com/multiformats/js-multibase
475502

476503

504+
Version 1.4.14
505+
--------------
506+
507+
Released on August 25, 2025.
508+
509+
- Fixed a bug where ActivityPub Discovery failed to recognize XHTML
510+
self-closing `<link>` tags. The HTML/XHTML parser now correctly handles
511+
whitespace before the self-closing slash (`/>`), improving compatibility
512+
with XHTML documents that follow the self-closing tag format.
513+
514+
477515
Version 1.4.13
478516
--------------
479517

@@ -736,6 +774,17 @@ Released on February 5, 2025.
736774
[#195]: https://github.com/fedify-dev/fedify/issues/195
737775

738776

777+
Version 1.3.21
778+
--------------
779+
780+
Released on August 25, 2025.
781+
782+
- Fixed a bug where ActivityPub Discovery failed to recognize XHTML
783+
self-closing `<link>` tags. The HTML/XHTML parser now correctly handles
784+
whitespace before the self-closing slash (`/>`), improving compatibility
785+
with XHTML documents that follow the self-closing tag format.
786+
787+
739788
Version 1.3.20
740789
--------------
741790

@@ -1116,6 +1165,17 @@ Released on November 30, 2024.
11161165
[#193]: https://github.com/fedify-dev/fedify/issues/193
11171166

11181167

1168+
Version 1.2.24
1169+
--------------
1170+
1171+
Released on August 25, 2025.
1172+
1173+
- Fixed a bug where ActivityPub Discovery failed to recognize XHTML
1174+
self-closing `<link>` tags. The HTML/XHTML parser now correctly handles
1175+
whitespace before the self-closing slash (`/>`), improving compatibility
1176+
with XHTML documents that follow the self-closing tag format.
1177+
1178+
11191179
Version 1.2.23
11201180
--------------
11211181

@@ -1529,6 +1589,17 @@ Released on October 31, 2024.
15291589
[#118]: https://github.com/fedify-dev/fedify/issues/118
15301590

15311591

1592+
Version 1.1.24
1593+
--------------
1594+
1595+
Released on August 25, 2025.
1596+
1597+
- Fixed a bug where ActivityPub Discovery failed to recognize XHTML
1598+
self-closing `<link>` tags. The HTML/XHTML parser now correctly handles
1599+
whitespace before the self-closing slash (`/>`), improving compatibility
1600+
with XHTML documents that follow the self-closing tag format.
1601+
1602+
15321603
Version 1.1.23
15331604
--------------
15341605

@@ -1983,6 +2054,17 @@ Released on October 20, 2024.
19832054
[#150]: https://github.com/fedify-dev/fedify/issues/150
19842055

19852056

2057+
Version 1.0.27
2058+
--------------
2059+
2060+
Released on August 25, 2025.
2061+
2062+
- Fixed a bug where ActivityPub Discovery failed to recognize XHTML
2063+
self-closing `<link>` tags. The HTML/XHTML parser now correctly handles
2064+
whitespace before the self-closing slash (`/>`), improving compatibility
2065+
with XHTML documents that follow the self-closing tag format.
2066+
2067+
19862068
Version 1.0.26
19872069
--------------
19882070

fedify/runtime/docloader.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,32 @@ test("getDocumentLoader()", async (t) => {
189189
});
190190
});
191191

192+
fetchMock.get("https://example.com/xhtml-link", {
193+
body: `<html>
194+
<head>
195+
<meta charset="utf-8" />
196+
<link
197+
rel=alternate
198+
type="application/activity+json"
199+
href="https://example.com/object" />
200+
</head>
201+
</html>`,
202+
headers: { "Content-Type": "application/xhtml+xml; charset=utf-8" },
203+
});
204+
205+
await t.step("XHTML <link>", async () => {
206+
assertEquals(await fetchDocumentLoader("https://example.com/xhtml-link"), {
207+
contextUrl: null,
208+
documentUrl: "https://example.com/object",
209+
document: {
210+
"@context": "https://www.w3.org/ns/activitystreams",
211+
id: "https://example.com/object",
212+
name: "Fetched object",
213+
type: "Object",
214+
},
215+
});
216+
});
217+
192218
fetchMock.get("https://example.com/html-a", {
193219
body: `<html>
194220
<head>

fedify/runtime/docloader.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ export async function getRemoteDocument(
235235
contentType === "application/xhtml+xml" ||
236236
contentType?.startsWith("application/xhtml+xml;"))
237237
) {
238-
const p = /<(a|link)((\s+[a-z][a-z:_-]*=("[^"]*"|'[^']*'|[^\s>]+))+)\/?>/ig;
238+
const p =
239+
/<(a|link)((\s+[a-z][a-z:_-]*=("[^"]*"|'[^']*'|[^\s>]+))+)\s*\/?>/ig;
239240
const p2 = /\s+([a-z][a-z:_-]*)=("([^"]*)"|'([^']*)'|([^\s>]+))/ig;
240241
const html = await response.text();
241242
let m: RegExpExecArray | null;

0 commit comments

Comments
 (0)