@web-atoms/core
Version:
31 lines (30 loc) • 981 B
JavaScript
System.register(["../web/services/MarkdownService", "./FormattedString"], function (_export, _context) {
"use strict";
var MarkdownService, FormattedString, Markdown;
_export("default", void 0);
return {
setters: [function (_webServicesMarkdownService) {
MarkdownService = _webServicesMarkdownService.default;
}, function (_FormattedString) {
FormattedString = _FormattedString.default;
}],
execute: function () {
_export("default", Markdown = class Markdown extends FormattedString {
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) : MarkdownService.instance;
return ms.toHtml(this.text);
}
});
}
};
});
//# sourceMappingURL=Markdown.js.map