function renderMarkdown(markdown, options) {
        if (options === void 0) { options = {}; }
        var element = createElement(options);
        var codeBlockRenderer = options.codeBlockRenderer, actionCallback = options.actionCallback;
        // signal to code-block render that the
        // element has been created
        var signalInnerHTML;
        var withInnerHTML = new winjs_base_1.TPromise(function (c) { return signalInnerHTML = c; });
        var renderer = new marked_1.marked.Renderer();
        renderer.image = function (href, title, text) {
            var dimensions = [];
            if (href) {
                var splitted = href.split('|').map(function (s) { return s.trim(); });
                href = splitted[0];
                var parameters = splitted[1];
                if (parameters) {
                    var heightFromParams = /height=(\d+)/.exec(parameters);
                    var widthFromParams = /width=(\d+)/.exec(parameters);
                    var height = (heightFromParams && heightFromParams[1]);
                    var width = (widthFromParams && widthFromParams[1]);
                    var widthIsFinite = isFinite(parseInt(width));
                    var heightIsFinite = isFinite(parseInt(height));
                    if (widthIsFinite) {
                        dimensions.push("width=\"" + width + "\"");
                    }
                    if (heightIsFinite) {
                        dimensions.push("height=\"" + height + "\"");
                    }
                }
            }
            var attributes = [];
            if (href) {
                attributes.push("src=\"" + href + "\"");
            }
            if (text) {
                attributes.push("alt=\"" + text + "\"");
            }
            if (title) {
                attributes.push("title=\"" + title + "\"");
            }
            if (dimensions.length) {
                attributes = attributes.concat(dimensions);
            }
            return '<img ' + attributes.join(' ') + '>';
        };
        renderer.link = function (href, title, text) {
            // Remove markdown escapes. Workaround for https://github.com/chjj/marked/issues/829
            if (href === text) {
                text = htmlContent_1.removeMarkdownEscapes(text);
            }
            title = htmlContent_1.removeMarkdownEscapes(title);
            href = htmlContent_1.removeMarkdownEscapes(href);
            if (!href || href.match(/^data:|javascript:/i)) {
                return text;
            }
            return "<a href=\"#\" data-href=\"" + href + "\" title=\"" + (title || text) + "\">" + text + "</a>";
        };
        renderer.paragraph = function (text) {
            return "<p>" + text + "</p>";
        };
        if (options.codeBlockRenderer) {
            renderer.code = function (code, lang) {
                var value = options.codeBlockRenderer(lang, code);
                if (typeof value === 'string') {
                    return value;
                }
                if (winjs_base_1.TPromise.is(value)) {
                    // when code-block rendering is async we return sync
                    // but update the node with the real result later.
                    var id_1 = idGenerator_1.defaultGenerator.nextId();
                    winjs_base_1.TPromise.join([value, withInnerHTML]).done(function (values) {
                        var strValue = values[0];
                        var span = element.querySelector("div[data-code=\"" + id_1 + "\"]");
                        if (span) {
                            span.innerHTML = strValue;
                        }
                    }, function (err) {
                        // ignore
                    });
                    return "<div class=\"code\" data-code=\"" + id_1 + "\">" + strings_1.escape(code) + "</div>";
                }
                return code;
            };
        }
        if (options.actionCallback) {
            DOM.addStandardDisposableListener(element, 'click', function (event) {
                if (event.target.tagName === 'A') {
                    var href = event.target.dataset['href'];
                    if (href) {
                        options.actionCallback(href, event);
                    }
                }
            });
        }
        element.innerHTML = marked_1.marked(markdown, {
            sanitize: true,
            renderer: renderer
        });
        signalInnerHTML();
        return element;
    }
Create html nodes for the given content element.

@param content a html element description
@param actionCallback a callback function for any action links in the string. Argument is the zero-based index of the clicked action.