Skip to content

Commit 9412e17

Browse files
committed
set xmlns attribute, instead of keeping
1 parent f3fa3d0 commit 9412e17

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

build/generate-svg.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,22 @@ async function processFile(file, {prefix, fullName} = {}) {
2525
if (prefix === 'octicon') name = name.replace(/-[0-9]+$/, ''); // chop of '-16' on octicons
2626
}
2727

28-
// keep the `xmlns` attribute so that the files are displayble in standalone documents
28+
// Set the `xmlns` attribute so that the files are displayable in standalone documents
2929
// The svg backend module will strip the attribute during startup for inline display
3030
const {data} = optimize(await readFile(file, 'utf8'), {
3131
plugins: [
3232
{name: 'preset-default'},
3333
{name: 'removeDimensions'},
3434
{name: 'prefixIds', params: {prefix: () => name}},
3535
{name: 'addClassesToSVGElement', params: {classNames: ['svg', name]}},
36-
{name: 'addAttributesToSVGElement', params: {attributes: [{'width': '16'}, {'height': '16'}, {'aria-hidden': 'true'}]}},
36+
{
37+
name: 'addAttributesToSVGElement', params: {
38+
attributes: [
39+
{'xmlns': 'http://www.w3.org/2000/svg'},
40+
{'width': '16'}, {'height': '16'}, {'aria-hidden': 'true'},
41+
]
42+
}
43+
},
3744
],
3845
});
3946

+1-1
Loading

public/img/svg/material-palette.svg

+1-1
Loading

0 commit comments

Comments
 (0)