Spaces:
Sleeping
Sleeping
File size: 2,182 Bytes
6abff73 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | "use strict";
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.DocCodeSpan = void 0;
const DocNode_1 = require("./DocNode");
const DocExcerpt_1 = require("./DocExcerpt");
/**
* Represents CommonMark-style code span, i.e. code surrounded by
* backtick characters.
*/
class DocCodeSpan extends DocNode_1.DocNode {
/**
* Don't call this directly. Instead use {@link TSDocParser}
* @internal
*/
constructor(parameters) {
super(parameters);
if (DocNode_1.DocNode.isParsedParameters(parameters)) {
this._openingDelimiterExcerpt = new DocExcerpt_1.DocExcerpt({
configuration: this.configuration,
excerptKind: DocExcerpt_1.ExcerptKind.CodeSpan_OpeningDelimiter,
content: parameters.openingDelimiterExcerpt
});
this._codeExcerpt = new DocExcerpt_1.DocExcerpt({
configuration: this.configuration,
excerptKind: DocExcerpt_1.ExcerptKind.CodeSpan_Code,
content: parameters.codeExcerpt
});
this._closingDelimiterExcerpt = new DocExcerpt_1.DocExcerpt({
configuration: this.configuration,
excerptKind: DocExcerpt_1.ExcerptKind.CodeSpan_ClosingDelimiter,
content: parameters.closingDelimiterExcerpt
});
}
else {
this._code = parameters.code;
}
}
/** @override */
get kind() {
return DocNode_1.DocNodeKind.CodeSpan;
}
/**
* The text that should be rendered as code, excluding the backtick delimiters.
*/
get code() {
if (this._code === undefined) {
this._code = this._codeExcerpt.content.toString();
}
return this._code;
}
/** @override */
onGetChildNodes() {
return [this._openingDelimiterExcerpt, this._codeExcerpt, this._closingDelimiterExcerpt];
}
}
exports.DocCodeSpan = DocCodeSpan;
//# sourceMappingURL=DocCodeSpan.js.map |