Added parameter to avoid using ranges when creating tspans for mobilesafari; Added support for CSS transforms. #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When creating tspans on mobile Safari using the ranges, the output comes out empty. Using text content + string manipulations yields correct results (tested on an iPhone SE and an iPad). The change doesn't seem to affect behaviour on a desktop.
CSS Transforms were completely ignored by the library, as far as I'm aware. As the HTML element contains CSS transforms, and SVG transforms operate on a different coordinate system, I had to convert CSS transforms to SVG transforms.
To do this, I've computed the
transform
attribute on the final svg element by:This method should work correctly with all kinds of SVG transformations, but I've only tested a rotation around the center, as that was my use case.