# HtmlRenderer- ability to customize element rendering? (javascript)

**URL:** <https://talk.commonmark.org/t/htmlrenderer-ability-to-customize-element-rendering-javascript/1057>\
**Category:** Implementation\
**Created:** [February 18, 2015, 4:27pm UTC](https://talk.commonmark.org/t/htmlrenderer-ability-to-customize-element-rendering-javascript/1057 "2015-02-18T16:27:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jgm](https://talk.commonmark.org/user_avatar/talk.commonmark.org/jgm/32/1360_2.png) [@jgm](https://talk.commonmark.org/u/jgm)\
**Post date:** [February 18, 2015, 6:08pm UTC](https://talk.commonmark.org/t/htmlrenderer-ability-to-customize-element-rendering-javascript/1057/2 "2015-02-18T18:08:48Z")

</div>

I’ve been meaning to make the renderer more customizable by splitting out renderers for individual elements and allowing them to be modified individually. Here’s an issue for this: [Make HTML renderer more customizable · Issue #6 · commonmark/commonmark.js · GitHub](https://github.com/jgm/commonmark.js/issues/6)

At this point you have two options:

1. Modify the HTML renderer (`lib/html.js`). Search for `case 'Link'` and it should be pretty obvious what to do.

2. Traverse the AST looking for links, and replace these with raw html elements. In practice this is ugly, especially since you’d have to do your own escaping, etc.

---

_[View the full topic](https://talk.commonmark.org/t/htmlrenderer-ability-to-customize-element-rendering-javascript/1057)._
