Have SugarCube leave my SVG alone

0 votes
asked Jul 16, 2017 by Herbert (150 points)
I am using SugarCube v2.19.0. I want to add interactive imagery using SVG graphics. Inline SVG is perfectly supported in HTML 5. Unfortunately, SugarCube seems to mangle all content with a JavaScript class named Wikifier. The Wikifier re-creates all SVG elements as HTML elements. As a result, the image data is no longer valid and no image is displayed.

How can I stop SugarCube from messing with my graphics? It seems, I need some kind of "raw input" specifier. Does something like this exist?

1 Answer

0 votes
answered Jul 16, 2017 by TheMadExile (44,590 points)
selected Jul 20, 2017 by Herbert
Best answer

Use the raw HTML markup, <html></html>.  For example:

<!-- Your SVG markup here. -->


commented Jul 17, 2017 by cedeo (110 points)
Does anyone know if this should also work with Harlowe? And if not, is there any way to use SVG directly? (I am able to base64 encode it and use it as a data-uri in an img tag, but would be nice to write out svg directly.
commented Jul 20, 2017 by Herbert (150 points)
For SugarCube this is it. Thank you.
Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.