Loading CHANGES.md +60 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,11 @@ Version 1.5.6 To be released. - Fixed a bug where ActivityPub Discovery failed to recognize XHTML self-closing `<link>` tags. The HTML/XHTML parser now correctly handles whitespace before the self-closing slash (`/>`), improving compatibility with XHTML documents that follow the self-closing tag format. Version 1.5.5 ------------- Loading Loading @@ -196,6 +201,17 @@ Released on March 28, 2025. [multibase]: https://github.com/multiformats/js-multibase Version 1.4.14 -------------- Released on August 25, 2025. - Fixed a bug where ActivityPub Discovery failed to recognize XHTML self-closing `<link>` tags. The HTML/XHTML parser now correctly handles whitespace before the self-closing slash (`/>`), improving compatibility with XHTML documents that follow the self-closing tag format. Version 1.4.13 -------------- Loading Loading @@ -458,6 +474,17 @@ Released on February 5, 2025. [#195]: https://github.com/fedify-dev/fedify/issues/195 Version 1.3.21 -------------- Released on August 25, 2025. - Fixed a bug where ActivityPub Discovery failed to recognize XHTML self-closing `<link>` tags. The HTML/XHTML parser now correctly handles whitespace before the self-closing slash (`/>`), improving compatibility with XHTML documents that follow the self-closing tag format. Version 1.3.20 -------------- Loading Loading @@ -838,6 +865,17 @@ Released on November 30, 2024. [#193]: https://github.com/fedify-dev/fedify/issues/193 Version 1.2.24 -------------- Released on August 25, 2025. - Fixed a bug where ActivityPub Discovery failed to recognize XHTML self-closing `<link>` tags. The HTML/XHTML parser now correctly handles whitespace before the self-closing slash (`/>`), improving compatibility with XHTML documents that follow the self-closing tag format. Version 1.2.23 -------------- Loading Loading @@ -1251,6 +1289,17 @@ Released on October 31, 2024. [#118]: https://github.com/fedify-dev/fedify/issues/118 Version 1.1.24 -------------- Released on August 25, 2025. - Fixed a bug where ActivityPub Discovery failed to recognize XHTML self-closing `<link>` tags. The HTML/XHTML parser now correctly handles whitespace before the self-closing slash (`/>`), improving compatibility with XHTML documents that follow the self-closing tag format. Version 1.1.23 -------------- Loading Loading @@ -1705,6 +1754,17 @@ Released on October 20, 2024. [#150]: https://github.com/fedify-dev/fedify/issues/150 Version 1.0.27 -------------- Released on August 25, 2025. - Fixed a bug where ActivityPub Discovery failed to recognize XHTML self-closing `<link>` tags. The HTML/XHTML parser now correctly handles whitespace before the self-closing slash (`/>`), improving compatibility with XHTML documents that follow the self-closing tag format. Version 1.0.26 -------------- Loading src/runtime/docloader.test.ts +30 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,36 @@ test("getDocumentLoader()", async (t) => { }); }); mf.mock("GET@/xhtml-link", (_req) => new Response( `<html> <head> <meta charset=utf-8> <link rel=alternate type="application/activity+json" href="https://example.com/object" /> </head> </html>`, { status: 200, headers: { "Content-Type": "application/xhtml+xml; charset=utf-8" }, }, )); await t.step("XHTML <link>", async () => { assertEquals(await fetchDocumentLoader("https://example.com/xhtml-link"), { contextUrl: null, documentUrl: "https://example.com/object", document: { "@context": "https://www.w3.org/ns/activitystreams", id: "https://example.com/object", name: "Fetched object", type: "Object", }, }); }); mf.mock("GET@/html-a", (_req) => new Response( `<html> Loading src/runtime/docloader.ts +2 −1 Original line number Diff line number Diff line Loading @@ -213,7 +213,8 @@ async function getRemoteDocument( contentType === "application/xhtml+xml" || contentType?.startsWith("application/xhtml+xml;")) ) { const p = /<(a|link)((\s+[a-z][a-z:_-]*=("[^"]*"|'[^']*'|[^\s>]+))+)\/?>/ig; const p = /<(a|link)((\s+[a-z][a-z:_-]*=("[^"]*"|'[^']*'|[^\s>]+))+)\s*\/?>/ig; const p2 = /\s+([a-z][a-z:_-]*)=("([^"]*)"|'([^']*)'|([^\s>]+))/ig; const html = await response.text(); let m: RegExpExecArray | null; Loading Loading
CHANGES.md +60 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,11 @@ Version 1.5.6 To be released. - Fixed a bug where ActivityPub Discovery failed to recognize XHTML self-closing `<link>` tags. The HTML/XHTML parser now correctly handles whitespace before the self-closing slash (`/>`), improving compatibility with XHTML documents that follow the self-closing tag format. Version 1.5.5 ------------- Loading Loading @@ -196,6 +201,17 @@ Released on March 28, 2025. [multibase]: https://github.com/multiformats/js-multibase Version 1.4.14 -------------- Released on August 25, 2025. - Fixed a bug where ActivityPub Discovery failed to recognize XHTML self-closing `<link>` tags. The HTML/XHTML parser now correctly handles whitespace before the self-closing slash (`/>`), improving compatibility with XHTML documents that follow the self-closing tag format. Version 1.4.13 -------------- Loading Loading @@ -458,6 +474,17 @@ Released on February 5, 2025. [#195]: https://github.com/fedify-dev/fedify/issues/195 Version 1.3.21 -------------- Released on August 25, 2025. - Fixed a bug where ActivityPub Discovery failed to recognize XHTML self-closing `<link>` tags. The HTML/XHTML parser now correctly handles whitespace before the self-closing slash (`/>`), improving compatibility with XHTML documents that follow the self-closing tag format. Version 1.3.20 -------------- Loading Loading @@ -838,6 +865,17 @@ Released on November 30, 2024. [#193]: https://github.com/fedify-dev/fedify/issues/193 Version 1.2.24 -------------- Released on August 25, 2025. - Fixed a bug where ActivityPub Discovery failed to recognize XHTML self-closing `<link>` tags. The HTML/XHTML parser now correctly handles whitespace before the self-closing slash (`/>`), improving compatibility with XHTML documents that follow the self-closing tag format. Version 1.2.23 -------------- Loading Loading @@ -1251,6 +1289,17 @@ Released on October 31, 2024. [#118]: https://github.com/fedify-dev/fedify/issues/118 Version 1.1.24 -------------- Released on August 25, 2025. - Fixed a bug where ActivityPub Discovery failed to recognize XHTML self-closing `<link>` tags. The HTML/XHTML parser now correctly handles whitespace before the self-closing slash (`/>`), improving compatibility with XHTML documents that follow the self-closing tag format. Version 1.1.23 -------------- Loading Loading @@ -1705,6 +1754,17 @@ Released on October 20, 2024. [#150]: https://github.com/fedify-dev/fedify/issues/150 Version 1.0.27 -------------- Released on August 25, 2025. - Fixed a bug where ActivityPub Discovery failed to recognize XHTML self-closing `<link>` tags. The HTML/XHTML parser now correctly handles whitespace before the self-closing slash (`/>`), improving compatibility with XHTML documents that follow the self-closing tag format. Version 1.0.26 -------------- Loading
src/runtime/docloader.test.ts +30 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,36 @@ test("getDocumentLoader()", async (t) => { }); }); mf.mock("GET@/xhtml-link", (_req) => new Response( `<html> <head> <meta charset=utf-8> <link rel=alternate type="application/activity+json" href="https://example.com/object" /> </head> </html>`, { status: 200, headers: { "Content-Type": "application/xhtml+xml; charset=utf-8" }, }, )); await t.step("XHTML <link>", async () => { assertEquals(await fetchDocumentLoader("https://example.com/xhtml-link"), { contextUrl: null, documentUrl: "https://example.com/object", document: { "@context": "https://www.w3.org/ns/activitystreams", id: "https://example.com/object", name: "Fetched object", type: "Object", }, }); }); mf.mock("GET@/html-a", (_req) => new Response( `<html> Loading
src/runtime/docloader.ts +2 −1 Original line number Diff line number Diff line Loading @@ -213,7 +213,8 @@ async function getRemoteDocument( contentType === "application/xhtml+xml" || contentType?.startsWith("application/xhtml+xml;")) ) { const p = /<(a|link)((\s+[a-z][a-z:_-]*=("[^"]*"|'[^']*'|[^\s>]+))+)\/?>/ig; const p = /<(a|link)((\s+[a-z][a-z:_-]*=("[^"]*"|'[^']*'|[^\s>]+))+)\s*\/?>/ig; const p2 = /\s+([a-z][a-z:_-]*)=("([^"]*)"|'([^']*)'|([^\s>]+))/ig; const html = await response.text(); let m: RegExpExecArray | null; Loading