8000 feat: add `fragmentIdentifier` option by weizhenye · Pull Request #33 · svgstore/svgstore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: add fragmentIdentifier option #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

weizhenye
Copy link

This PR implements #24

SVG file may lack of width, height, viewBox attributes, it's hard to get width and height from SVG file without render it, so I introduce @resvg/resvg-js library to calc them.

For now SVG Fragment Identifiers feature is opt-in, <symbol> is still work, so id of <view> should not be same with <symbol>, it requires a custom function to get <view>'s id. Another way is treat SVG Fragment Identifiers as another mode which don't set id to <symbol>, only <view> works. I'm not sure which it better, what do you think?

I'm not a native English speaker, edits in REAME may not precise, feel free to edit it.

tomasvn added a commit to tomasvn/svgstore that referenced this pull request Jun 3, 2025
@tomasvn
Copy link
tomasvn commented Jun 3, 2025

@weizhenye I've implemented your suggestion, and released a fork of svgstore package, https://www.npmjs.com/package/@tomasvn/svgstore try it, if you still needed, I might use it as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0