Skip to content

Commit

Permalink
fix: add quotes to href attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
haocheng6 committed Dec 26, 2023
1 parent 754683a commit f797375
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const remarkGithubCodeImport: Plugin<[options: Options] | void[], Root> = (
node,
{
type: 'html',
value: `<div class="github-code-link"><a href=${url} target="_blank">See full example on GitHub</a></div>`,
value: `<div class="github-code-link"><a href="${url}" target="_blank">See full example on GitHub</a></div>`,
} satisfies Html,
{
type: 'html',
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/output/entire_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ export function once(fn) {
}
```

<div class="github-code-link"><a href=https://github.com/user/repo/blob/branch/folder/example.js target="_blank">See full example on GitHub</a></div>
<div class="github-code-link"><a href="https://github.com/user/repo/blob/branch/folder/example.js" target="_blank">See full example on GitHub</a></div>

</div>
2 changes: 1 addition & 1 deletion test/fixtures/output/line_range.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
};
```

<div class="github-code-link"><a href=https://github.com/user/repo/blob/branch/folder/example.js#L6-L12 target="_blank">See full example on GitHub</a></div>
<div class="github-code-link"><a href="https://github.com/user/repo/blob/branch/folder/example.js#L6-L12" target="_blank">See full example on GitHub</a></div>

</div>
2 changes: 1 addition & 1 deletion test/fixtures/output/line_range_dedented.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ return function (...args) {
};
```

<div class="github-code-link"><a href=https://github.com/user/repo/blob/branch/folder/example.js#L6-L12 target="_blank">See full example on GitHub</a></div>
<div class="github-code-link"><a href="https://github.com/user/repo/blob/branch/folder/example.js#L6-L12" target="_blank">See full example on GitHub</a></div>

</div>

0 comments on commit f797375

Please sign in to comment.