UNPKG

greybel-languageserver-core

Version:
31 lines 884 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MarkdownString = void 0; class MarkdownString { constructor(value = '') { this.sanitize = true; this.value = value; } appendText(value) { // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash this.value += value.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); return this; } appendMarkdown(value) { this.value += value; return this; } appendCodeblock(langId, code) { this.value += '\n```'; this.value += langId; this.value += '\n'; this.value += code; this.value += '\n```\n'; return this; } toString() { return this.value; } } exports.MarkdownString = MarkdownString; //# sourceMappingURL=markdown-string.js.map