@microsoft.azure/autorest.incubator
Version:
AutoRest incubator project
39 lines • 1.43 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const text_manipulation_1 = require("../../common/text-manipulation");
exports.summary = (text) => xmlize('summary', text);
function remarks(externalDocs) {
if (externalDocs) {
if (externalDocs.url) {
if (externalDocs.description) {
if (externalDocs.description.trim().endsWith(':')) {
return `${text_manipulation_1.EOL}${xmlize('remarks', `${externalDocs.description}${text_manipulation_1.EOL}${externalDocs.url}`)}`;
}
return `${text_manipulation_1.EOL}${xmlize('remarks', `${externalDocs.description}${text_manipulation_1.EOL}see: ${externalDocs.url}`)}`;
}
return `${text_manipulation_1.EOL}${xmlize('remarks', `see: ${externalDocs.url}`)}`;
}
else {
if (externalDocs.description) {
return `${text_manipulation_1.EOL}${xmlize('remarks', externalDocs.description)}`;
}
}
}
return '';
}
exports.remarks = remarks;
function xmlize(element, text) {
if (text) {
if (text.length < 80 && text.indexOf(text_manipulation_1.EOL) === -1) {
return `<${element}>${text.trim()}</${element}>`;
}
return `
<${element}>
${text}
</${element}>
`.trim();
}
return text;
}
exports.xmlize = xmlize;
//# sourceMappingURL=doc-comments.js.map