(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports", "../web/services/MarkdownService", "./FormattedString"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    const MarkdownService_1 = require("../web/services/MarkdownService");
    const FormattedString_1 = require("./FormattedString");
    class Markdown extends FormattedString_1.default {
        static from(text) {
            return new Markdown(text);
        }
        applyTo(app, element) {
            element.innerHTML = this.toHtmlString(app);
        }
        toString() {
            return this.text;
        }
        toHtmlString(app) {
            const ms = app
                ? app.resolve(MarkdownService_1.default)
                : MarkdownService_1.default.instance;
            return ms.toHtml(this.text);
        }
    }
    exports.default = Markdown;
});
//# sourceMappingURL=Markdown.js.map