Closed exKAZUu closed 4 years ago
We cannot enable inlineSVG
by default yet. There are 2 reasons.
Inline SVG mode is still experimental because there is a long-standing bug in WebKit's SVG scaling. The most important benefit of inlineSVG: true
is no required any browser JavaScript but WebKit requires polyfill.
Marpit framework focuses not only for Marp tools but also for joint working with other famous frameworks such as reveal.js, WebSlides, and so on. Inline SVG mode has a lot of side-effects to the rendered result and it may break the structure for slides defined by adopted framework. Thus, we have to keep the least surprise by default.
Currently Marpit v2 (#194) and later also have no plan of this. The first step to clear up your confusion is raising our voice to WebKit. (https://bugs.webkit.org/show_bug.cgi?id=23113)
NOTE: Marp Core and followed Marp tools have no restrictions about executing browser JS. So we can use WebKit polyfill and useful helpers (e.g. auto-scaling code block and math). However, we still hope to require no scripts if possible.
I see. Thank you for the explanation.
HTML files generated by marp-core
and marp-cli
(with bespoke
or bare
template) require the polyfill for WebKit browsers, right?
(sorry in advance, if this is off-topic here). If so, I believe it's worth explaining that in the documents of these tools (e.g. https://github.com/marp-team/marp-core#marp-markdown, https://github.com/marp-team/marp-cli#convert-to-html and/or https://github.com/marp-team/marp-cli#template). If you agree, I'm happy to try contributing.
It's not right. Marp Core has already included WebKit polyfill in Marp.ready()
, and Marp CLI will detect and bundle this script automatically. So generated HTML in Marp CLI can render in WebKit browser correctly. User has not to take care anything.
Oh, okay. I didn't understand the behavior. Thanks!
I feel this inconsistency is a bit confusing (actually, I expected
inlineSVG
was disabled in other tools).inlineSVG
seems one of key features in the tools, so I'd recommend to enable it in marpit, too. (But, I can understand the current design (a framework v.s. tools), so it's okay just to close this issue.)