Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ All notable product changes will be recorded in this file.
`textContent` fallback.
- Added page title provenance to Markdown output.
- Kept page titles inside a Markdown-inert untrusted-content fence.
- Canonicalized supported source URLs without query parameters or fragments.
- Added structural blockquote boundaries for untrusted body and comment
previews.
- Added regression checks for hidden content, Markdown structure, background
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ a complete GitHub conversation exporter.

- recognizes GitHub Issue pages
- recognizes GitHub Pull Request conversation pages
- extracts the visible title, source URL, body preview, and visible comment snippets
- extracts the visible title, canonical source URL without query/fragment data, body preview, and visible comment snippets
- creates a Markdown preview with the title, explicit limitations, and a review-before-sharing warning
- keeps the title inside a Markdown-inert fenced block and body/comment previews inside an explicit untrusted-content blockquote boundary
- copies the Markdown to the clipboard
Expand Down
2 changes: 1 addition & 1 deletion docs/01_requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Pull Request support is limited to the Conversation page.
- repository owner and name
- Issue or Pull Request number
- page type
- source URL
- canonical source URL without query parameters or fragments

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Align the manual checks with canonical URL export

When verifying a page opened with query parameters or a fragment, the manual guide and result template still require the “current ... page URL,” so they neither describe nor test the new requirement that those components be removed. Update docs/07_manual_verification.md and docs/08_manual_verification_result_template.md to require the canonical URL and include a query/fragment case; otherwise the repository's prescribed verification can pass without exercising this behavior.

AGENTS.md reference: AGENTS.md:L58-L60

Useful? React with 👍 / 👎.

- export timestamp
- exporter name

Expand Down
3 changes: 2 additions & 1 deletion docs/03_status.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Maintainer-controlled public OSS preview.
- Chrome Manifest V3 popup
- GitHub Issue and Pull Request Conversation URL classification
- self-contained visible-page metadata injection
- visible title, source URL, body preview, and visible comment snippets
- visible title, canonical source URL without query/fragment data, body
preview, and visible comment snippets
- rendered-visibility checks that reject hidden, inert, transparent, or
non-rendered body/comment elements
- explicit body selectors that do not promote the first comment into a
Expand Down
5 changes: 4 additions & 1 deletion src/extractor/pageMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ export function extractVisiblePageMetadata() {
const heading = normalizeText(document.querySelector("h1")?.innerText);
const path = document.location.pathname;
const pageKind = classifyPageKind(path);
const canonicalUrl = pageKind
? `https://github.com${path.replace(/\/$/, "")}`
: "";

let visibleContentPreview = "";
let visibleContentStatus = "not_applicable";
Expand Down Expand Up @@ -108,7 +111,7 @@ export function extractVisiblePageMetadata() {
return {
title,
heading,
url: document.location.href,
url: canonicalUrl,
visibleContentPreview,
visibleContentStatus,
visibleComments,
Expand Down
4 changes: 2 additions & 2 deletions test/pageMetadata.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ test("runs as a self-contained injected function for an Issue page", () => {
kind: "issue",
title: "Example issue · GitHub",
heading: "Example issue",
url: "https://github.com/octo-org/example/issues/123",
url: "https://github.com/octo-org/example/issues/123?notification_referrer_id=synthetic#issuecomment-synthetic",
body: "Visible issue body",
comments: ["First visible comment"]
}));
Expand All @@ -80,7 +80,7 @@ test("runs as a self-contained injected function for a Pull Request page", () =>
kind: "pull request",
title: "Example pull request · GitHub",
heading: "Example pull request",
url: "https://github.com/octo-org/example/pull/456",
url: "https://github.com/octo-org/example/pull/456/?synthetic=1#discussion_rsynthetic",
body: "Visible pull request body",
comments: ["Review conversation comment"]
}));
Expand Down