Closed fregante closed 6 years ago
Why not use the new text
option in create-html-element
?
Because a I'm a dummy
However it doesn't look any better
Edit: or perhaps this? Still much longer
const linkify = (href, options) => {
const opts = {
name: 'a',
attributes: Object.assign({href: ''}, options.attributes, {href})
};
if (typeof options.value === 'undefined') {
opts.value = href;
} else {
opts.html = options.value;
}
createHtmlElement(opts);
};
What if we change this module to have a text and html option too instead of value?
As part of #10 yes
Fixes #14 Fixes sindresorhus/refined-github#811
It does not escape the
value
because the user might not want that and we don't want an option for that. So they should useescape-goat
explicitly in that case.