mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-05 03:21:16 +08:00
DISABLE_THIRD_PARTY_CHECK=NPM fix R=jacktfranklin@chromium.org Bug: none Change-Id: I41baa3294f88b7e4463fdc580c050932c5abe40e Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3372932 Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
31 lines
666 B
JavaScript
31 lines
666 B
JavaScript
'use strict';
|
|
|
|
exports.name = 'removeXMLNS';
|
|
|
|
exports.type = 'perItem';
|
|
|
|
exports.active = false;
|
|
|
|
exports.description =
|
|
'removes xmlns attribute (for inline svg, disabled by default)';
|
|
|
|
/**
|
|
* Remove the xmlns attribute when present.
|
|
*
|
|
* @example
|
|
* <svg viewBox="0 0 100 50" xmlns="http://www.w3.org/2000/svg">
|
|
* ↓
|
|
* <svg viewBox="0 0 100 50">
|
|
*
|
|
* @param {Object} item current iteration item
|
|
* @return {Boolean} if true, xmlns will be filtered out
|
|
*
|
|
* @author Ricardo Tomasi
|
|
*/
|
|
exports.fn = function (item) {
|
|
if (item.type === 'element' && item.name === 'svg') {
|
|
delete item.attributes.xmlns;
|
|
delete item.attributes['xmlns:xlink'];
|
|
}
|
|
};
|