Fix issue with <title> namespace inside an svg (#1284)

This commit is contained in:
Dylan Piercey 2019-03-13 13:59:56 -07:00 committed by GitHub
parent f46c8d5f14
commit c96d181cd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 1 deletions

View File

@ -47,7 +47,8 @@ function finalizeCreateArgs(createArgs, builder) {
const MAYBE_SVG = {
a: true,
script: true,
style: true
style: true,
title: true
};
const SIMPLE_ATTRS = {

View File

@ -0,0 +1,36 @@
"use strict";
var marko_template = module.exports = require("marko/src/vdom").t(),
components_helpers = require("marko/src/components/helpers"),
marko_registerComponent = components_helpers.rc,
marko_componentType = marko_registerComponent("/marko-test$1.0.0/compiler/fixtures-vdom/svg-title/template.marko", function() {
return module.exports;
}),
marko_renderer = components_helpers.r,
marko_defineComponent = components_helpers.c,
marko_helpers = require("marko/src/runtime/vdom/helpers"),
marko_createElement = marko_helpers.e,
marko_const = marko_helpers.const,
marko_const_nextId = marko_const("a0adc5"),
marko_node0 = marko_createElement("svg", {
width: "140",
height: "30"
}, "0", null, 1, 1, {
i: marko_const_nextId()
})
.e("g", null, null, null, 1, 1)
.e("title", null, null, null, 1, 1)
.t("This is a tool tip");
function render(input, out, __component, component, state) {
var data = input;
out.n(marko_node0, component);
}
marko_template._ = marko_renderer(render, {
___implicit: true,
___type: marko_componentType
});
marko_template.Component = marko_defineComponent({}, marko_template._);

View File

@ -0,0 +1,5 @@
<svg width="140" height="30">
<g>
<title>This is a tool tip</title>
</g>
</svg>

After

Width:  |  Height:  |  Size: 95 B