Open ptbrowne opened 5 years ago
You can find our custom renderers here: https://github.com/cozy/cozy-libs/blob/master/packages/cozy-harvest-lib/src/components/Markdown.jsx
We use it specially for styling purpose but also for referrer.
This is something we can't do with snarkdown. It seems that te recommended way is to pipe the result of snarkdown
and make the transformation ourself (https://github.com/developit/snarkdown/issues/5#issuecomment-282924371)
It seems that te recommended way is to pipe the result of snarkdown and make the transformation ourself.
I'd be OK with that.
We could also do :
const snarkWithNoReferer = content => {
const div = createElement('div')
div.innerHTML = snarkdown(content)
div.querySelectorAll('a').forEach(a => a.setAttribute('noreferer', true))
return div.innerHTML
}
This way we do not have to deal with regexps.
https://github.com/cozy/cozy-libs/pull/758
I wanted to know what kind of renderers we use and why ? And explore what could we do not to use them ?