Why does GitHub Markdown not allow embeddings of interactive SVG animations? #151372
Replies: 4 comments 1 reply
This comment was marked as spam.
This comment was marked as spam.
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
|
If I remember correctly, markdown html embeds was allowed ONLY in the Main Profile page README.md file (The one that you have your cards and the About-me information of your profile). ADDITIONAL UPDATES:
Overall, I believe is more feasible on github wiki pages to include for documentation and on the main about README.md page for more interactive content. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Select Topic Area
Question
Body
Scalable Vector Graphics (SVGs) can be animated purely with CSS such that they depend on user input (e.g. via :hover).
This would give huge potential to the customization of readme files and forum posts (in issues and discussions).
However, GitHub Flavored Markdown (GFM) doesn't allow user inputs to reach the SVG because it only supports images via
<img>, but true embedding would require something like<embed>or<object>to function properly.I doubt CSS can do anything harmful, and HTML+JS in
<foreignObject><iframe>could still be sanitized away, as is already the case.So why does GitHub disallow this? Have you considered enabling such features in a restricted way (e.g. embed only pre-sanatized local files)? Is there any security risk involved at all when allowing to embed pure SVG+CSS?
On another note, I think the current behavior of
<object>in GFM is problematic:Instead of at least showing the
.svgfile statically (via<img>), it uses the fallback image, which should be rasterized and tends to be much bigger than its vector graphics image, potentially increasing website traffic drastically.For illustration, I created a repository at xamidi/interactive-svg-graphs.
All reactions