## The problem to solve The objective: Go from this: `GitHub` To this: `GitHub ` (convert anchor tag to paragraph tag and then set paragraphs' inner content as a combination of anchor's innerText with the href attribute) I was trying to achieve this through `transformTags` but noticed that there is no way to access `innerText` of the anchor's tag. ## Proposed solution Something like this, below the third argument is new but maybe even exposing the innerText from `attribs` argument would be just fine. ``` transformTags: { a: function (_tagName: string, attribs: Attributes, text: string) { return { tagName: 'p', attribs: {}, text: `${text} <${attribs.href}>`, }; }, }, ``` ## Alternatives No alternatives in mind at this time. ## Additional context Kinda relatable: https://github.com/apostrophecms/sanitize-html/issues/690
The problem to solve
The objective:
Go from this:
<a href="http://github.com">GitHub</a>To this:
<p>GitHub <http://github.com></p>(convert anchor tag to paragraph tag and then set paragraphs' inner content as a combination of anchor's innerText with the href attribute)
I was trying to achieve this through
transformTagsbut noticed that there is no way to accessinnerTextof the anchor's tag.Proposed solution
Something like this, below the third argument is new but maybe even exposing the innerText from
attribsargument would be just fine.Alternatives
No alternatives in mind at this time.
Additional context
Kinda relatable: #690