Skip to content

Commit

Permalink
Fixed the issue with the copied icon SVG (#13169)
Browse files Browse the repository at this point in the history
  • Loading branch information
ridemountainpig committed Jun 26, 2024
1 parent 3b93c80 commit 5c09757
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions extensions/fontawesome/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Font Awesome Changelog

## [Fixed the issue with the copied icon SVG] - 2024-06-26

- Fixed issue with icon "Copy as SVG" copies [object Object] onto the clipboard instead of the SVG.

## [Added fuzzy search and icon style and family selection] - 2024-06-02

- Search command now uses Font Awesome's official graphql APIs to support fuzzy search. It is now faster, more accurate and shows similar icons to your query.
Expand Down
3 changes: 2 additions & 1 deletion extensions/fontawesome/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"author": "dutzi",
"contributors": [
"GLaDO8",
"danielferguson"
"danielferguson",
"ridemountainpig"
],
"categories": [
"Design Tools",
Expand Down
2 changes: 1 addition & 1 deletion extensions/fontawesome/src/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Clipboard, showHUD, ActionPanel, Action } from '@raycast/api';

export const copySvgToClipboard = async (icon: SearchItem) => {
// Since v6, Font Awesome stopped setting the SVGs fill color to currentColor, this restores that behavior.
const svgWithCurrentColor = icon.svgs[0].toString().replace(/<path/g, '<path fill="currentColor"');
const svgWithCurrentColor = icon.svgs[0]['html'].toString().replace(/<path/g, '<path fill="currentColor"');
await Clipboard.copy(svgWithCurrentColor);
await showHUD('Copied SVG to clipboard!');
};
Expand Down

0 comments on commit 5c09757

Please sign in to comment.