# HG changeset patch # User Alexander Plavin # Date 2013-09-06 09:30:58 # Node ID fdd41257def8c71779870e5e70dec0e038b80bc8 # Parent ac68009c31a4234419333cc299a558337a130780 hgweb: add appendFormatHTML javascript function This is a convenient helper function to append some formatted HTML markup to a DOM element. diff --git a/mercurial/templates/static/mercurial.js b/mercurial/templates/static/mercurial.js --- a/mercurial/templates/static/mercurial.js +++ b/mercurial/templates/static/mercurial.js @@ -341,3 +341,7 @@ function docFromHTML(html) { doc.documentElement.innerHTML = html; return doc; } + +function appendFormatHTML(element, formatStr, replacements) { + element.insertAdjacentHTML('beforeend', format(formatStr, replacements)); +}