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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Version must be kept in-sync between [`package.json`](package.json) and [`wxt.config.js`](wxt.config.ts).

## [Unreleased]
### Fixed
- Appending to GitHub issues was not being enhanced, now fixed. ([#105](https://github.com/diffplug/gitcasso/issues/105))

## [1.0.0] - 2025-10-02
- Fix html escaping inside single-tick and double-tick code blocks.
- Add syntax highlighting for github-style #number.
Expand Down
4 changes: 2 additions & 2 deletions src/lib/enhancers/github/GitHubIssueAppendEnhancer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export class GitHubIssueAppendEnhancer
const number = parseInt(numberStr!, 10)
const unique_key = `github.com:${slug}:${number}`
const title = document
.querySelector("main h1")!
.textContent.replace(/\s*#\d+$/, "")
.querySelector("main h2")!
.textContent!.replace(/\s*#\d+$/, "")
.trim()
return {
domain: location.host,
Expand Down
161 changes: 82 additions & 79 deletions tests/corpus/gh_issue.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions tests/lib/enhancers/__snapshots__/gh-detection.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`github detection > gh_issue:should detect correct spots 1`] = `
[
{
"for": "id=:rn: name=null className=prc-Textarea-TextArea-13q4j overtype-input",
"for": "id=:r2q: name=null className=prc-Textarea-TextArea-13q4j overtype-input",
"spot": {
"domain": "github.com",
"number": 523,
Expand Down Expand Up @@ -32,7 +32,7 @@ exports[`github detection > gh_issue_edit:should detect correct spots 1`] = `
"domain": "github.com",
"number": 56,
"slug": "diffplug/gitcasso",
"title": "what about the draft?",
"title": "Description",
"type": "GH_ISSUE_APPEND",
"unique_key": "github.com:diffplug/gitcasso:56",
},
Expand Down Expand Up @@ -64,7 +64,7 @@ exports[`github detection > gh_issue_edit_multiple:should detect correct spots 1
"domain": "github.com",
"number": 3,
"slug": "diffplug/testing-deletable",
"title": "Test 3",
"title": "Description",
"type": "GH_ISSUE_APPEND",
"unique_key": "github.com:diffplug/testing-deletable:3",
},
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/enhancers/__snapshots__/gh-ui.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`github ui > gh_issue:should render correct UI elements 1`] = `
[
{
"for": "id=:rn: name=null className=prc-Textarea-TextArea-13q4j overtype-input",
"for": "id=:r2q: name=null className=prc-Textarea-TextArea-13q4j overtype-input",
"title": "[jvm] docs for VCR",
"upperDecoration": <React.Fragment>
<span
Expand Down Expand Up @@ -39,7 +39,7 @@ exports[`github ui > gh_issue_edit:should render correct UI elements 1`] = `
},
{
"for": "id=:ra7: name=null className=prc-Textarea-TextArea-13q4j overtype-input",
"title": "what about the draft?",
"title": "Description",
"upperDecoration": <React.Fragment>
<span
className="flex h-4 w-4 flex-shrink-0 items-center justify-center"
Expand Down Expand Up @@ -81,7 +81,7 @@ exports[`github ui > gh_issue_edit_multiple:should render correct UI elements 1`
},
{
"for": "id=:r5b: name=null className=prc-Textarea-TextArea-13q4j overtype-input",
"title": "Test 3",
"title": "Description",
"upperDecoration": <React.Fragment>
<span
className="flex h-4 w-4 flex-shrink-0 items-center justify-center"
Expand Down