�PNG  IHDR��;���IDATx��ܻn�0���K�� �)(�pA��� ���7�LeG{�� �§㻢|��ذaÆ 6lذaÆ 6lذaÆ 6lom��$^�y���ذag�5bÆ 6lذaÆ 6lذa{���� 6lذaÆ �`����}H�Fkm�,�m����Ӫ���ô�ô!� �x�|'ܢ˟;�E:���9�&ᶒ�}�{�v]�n&�6� �h��_��t�ڠ͵-ҫ���Z;��Z$�.�P���k�ž)�!��o���>}l�eQfJ�T��u і���چ��\��X=8��Rن4`Vw�l�>����n�G�^��i�s��"ms�$�u��i��?w�bs[m�6�K4���O���.�4��%����/����b�C%��t ��M�ז� �-l�G6�mrz2���s�%�9��s@���-�k�9�=���)������k�B5����\��+͂�Zsٲ ��Rn��~G���R���C����� �wIcI��n7jJ���hۛNCS|���j0��8y�iHKֶۛ�k�Ɉ+;Sz������L/��F�*\��Ԕ�#"5��m�2��[S��������=�g��n�a�P�e�ғ�L�� lذaÆ 6l�^k��̱aÆ 6lذaÆ 6lذa;���� �_��ذaÆ 6lذaÆ 6lذaÆ ���R���IEND�B` 'use strict'; const { closestByName } = require('../lib/xast.js'); exports.type = 'perItem'; exports.active = false; exports.description = 'adds attributes to an outer element'; var ENOCLS = `Error in plugin "addAttributesToSVGElement": absent parameters. It should have a list of "attributes" or one "attribute". Config example: plugins: [ { name: 'addAttributesToSVGElement', params: { attribute: "mySvg" } } ] plugins: [ { name: 'addAttributesToSVGElement', params: { attributes: ["mySvg", "size-big"] } } ] plugins: [ { name: 'addAttributesToSVGElement', params: { attributes: [ { focusable: false }, { 'data-image': icon } ] } } ] `; /** * Add attributes to an outer element. Example config: * * @author April Arcus */ exports.fn = (node, params) => { if ( node.type === 'element' && node.name === 'svg' && closestByName(node.parentNode, 'svg') == null ) { if (!params || !(Array.isArray(params.attributes) || params.attribute)) { console.error(ENOCLS); return; } const attributes = params.attributes || [params.attribute]; for (const attribute of attributes) { if (typeof attribute === 'string') { if (node.attributes[attribute] == null) { node.attributes[attribute] = undefined; } } if (typeof attribute === 'object') { for (const key of Object.keys(attribute)) { if (node.attributes[key] == null) { node.attributes[key] = attribute[key]; } } } } } };