-
Notifications
You must be signed in to change notification settings - Fork 436
Maybe there is something wrong with the output of termtosvg #86
Comments
Corresponding SO post, just in case. |
Issue #61 may be linked to this. When I tried to embed term2svg SVGs into readmes or issues on GitHub it would not work unless it was hosted elsewhere, like https://rawgit.com or https://github.io. I thought it was just some GitHub specific thing. However, it seems the parrot and shark SVGs work fine in your repo, so it may be caused by termtosvg output after all. |
It's the best place for this :) Thanks for reporting the issue. I did some tests and it turns out GitHub sanitizes all relative links to SVG files in A workaround for this is to link to the full URL of the SVG file hosted on GitHub pages (see README.md for an example). svg-term-cli uses CSS keyframes to animate the terminal screen by translating lines in and out of the viewable part of the image. GitHub seems to tolerate that kind of animation so I'll consider switching to it. I too thought it was just GitHub that required SVGs to be hosted elsewhere. |
@nbedos @nnist I was close. I didn't realize that animation tag came under scripts because while researching about why this was happening I came to know that GitHub removes scripts, but when I searched for script tags in raw content I never found them. So i gave up and reluctantly thought of letting you know because the tool is amazing but having a very important use case stripped away from it drastically reduces the amount of people who would want to use it. |
I don't know yet, I'll have to do some testing. |
It's been a while but I've finally found some time to work on this. I changed termtosvg so that animations work roughly like those generated by svg-term-cli. These should bring the following improvements:
I've only found one regression which is that using Firefox, when zooming on an animation, some lines jump up and down by one pixel between two frames. I cannot reproduce this issue with Chromium. You can see here a README including a relative link to an animation : https://github.com/nbedos/termtosvg/blob/feature/css_animation/README.md Updated examples are located here : https://github.com/nbedos/termtosvg/tree/feature/css_animation/docs/examples I have to do a few more tests but it looks good so far. |
termtosvg now allows defining animations using either CSS or the Web Animations API. The choice to use CSS or WAAPI is done by template creators (see https://github.com/nbedos/termtosvg/blob/develop/man/termtosvg-templates.md) This has been has been included in release 0.9.0 |
I am not sure if this is the correct place to ask this, but my experiments led me to believe that there are some issues with the svg output by termtosvg.
Why?
The svgs output by termtosvg don't seem to be rendered by GitHub, whereas other random online svgs and by another tool svg-term-cli seem to work well with GitHub.
Test
I created this repository that showcases this well enough. svgs are inside
docs
folder andREADME.md
tries to show them. All the svgs except your own svg that I downloded from your README as well as one that I made using your tool fail to render whereas others work.I tried all the ways I think -
?sanitize=true
Any idea why this might be happening ?
The text was updated successfully, but these errors were encountered: