Unverified Commit 8560b537 authored by Hong Minhee's avatar Hong Minhee
Browse files

Merge tag '1.1.24' into 1.2-maintenance

Fedify 1.1.24
parents f12f1599 d46b13ec
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -8,6 +8,11 @@ Version 1.2.24

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.2.23
--------------
@@ -422,6 +427,17 @@ Released on October 31, 2024.
[#118]: https://github.com/dahlia/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
--------------

@@ -876,6 +892,17 @@ Released on October 20, 2024.
[#150]: https://github.com/dahlia/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
--------------

+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@
    "@logtape/logtape": "jsr:@logtape/logtape@^0.7.2",
    "@phensley/language-tag": "npm:@phensley/language-tag@^1.9.0",
    "@std/assert": "jsr:@std/assert@^0.226.0",
    "@std/async": "jsr:@std/async@^1.0.5",
    "@std/async": "jsr:@std/async@1.0.5",
    "@std/bytes": "jsr:@std/bytes@^1.0.2",
    "@std/collections": "jsr:@std/collections@^1.0.6",
    "@std/encoding": "jsr:@std/encoding@1.0.7",
+30 −0
Original line number Diff line number Diff line
@@ -209,6 +209,36 @@ test("fetchDocumentLoader()", 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>
+2 −1
Original line number Diff line number Diff line
@@ -166,7 +166,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;