Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102320994
removeStyleElement.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Feb 19, 11:54
Size
604 B
Mime Type
text/html
Expires
Fri, Feb 21, 11:54 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24330278
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
removeStyleElement.js
View Options
'use strict';
const { detachNodeFromParent } = require('../lib/xast.js');
exports.name = 'removeStyleElement';
exports.type = 'visitor';
exports.active = false;
exports.description = 'removes <style> element (disabled by default)';
/**
* Remove <style>.
*
* https://www.w3.org/TR/SVG11/styling.html#StyleElement
*
* @author Betsy Dupuis
*
* @type {import('../lib/types').Plugin<void>}
*/
exports.fn = () => {
return {
element: {
enter: (node, parentNode) => {
if (node.name === 'style') {
detachNodeFromParent(node, parentNode);
}
},
},
};
};
Event Timeline
Log In to Comment