azdo-cli 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +64 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1250,6 +1250,68 @@ function decodeEntitiesInMarkdownCodeSpans(text) {
|
|
|
1250
1250
|
return "`" + decoded + "`";
|
|
1251
1251
|
});
|
|
1252
1252
|
}
|
|
1253
|
+
var ADO_NAMED_ENTITIES = {
|
|
1254
|
+
// HTML special characters
|
|
1255
|
+
lt: "<",
|
|
1256
|
+
gt: ">",
|
|
1257
|
+
quot: '"',
|
|
1258
|
+
apos: "'",
|
|
1259
|
+
// Dashes and punctuation
|
|
1260
|
+
mdash: "\u2014",
|
|
1261
|
+
ndash: "\u2013",
|
|
1262
|
+
hellip: "\u2026",
|
|
1263
|
+
lsquo: "\u2018",
|
|
1264
|
+
rsquo: "\u2019",
|
|
1265
|
+
ldquo: "\u201C",
|
|
1266
|
+
rdquo: "\u201D",
|
|
1267
|
+
sbquo: "\u201A",
|
|
1268
|
+
bdquo: "\u201E",
|
|
1269
|
+
laquo: "\xAB",
|
|
1270
|
+
raquo: "\xBB",
|
|
1271
|
+
lsaquo: "\u2039",
|
|
1272
|
+
rsaquo: "\u203A",
|
|
1273
|
+
// Common symbols
|
|
1274
|
+
copy: "\xA9",
|
|
1275
|
+
reg: "\xAE",
|
|
1276
|
+
trade: "\u2122",
|
|
1277
|
+
nbsp: "\xA0",
|
|
1278
|
+
euro: "\u20AC",
|
|
1279
|
+
pound: "\xA3",
|
|
1280
|
+
yen: "\xA5",
|
|
1281
|
+
cent: "\xA2",
|
|
1282
|
+
deg: "\xB0",
|
|
1283
|
+
plusmn: "\xB1",
|
|
1284
|
+
times: "\xD7",
|
|
1285
|
+
divide: "\xF7",
|
|
1286
|
+
micro: "\xB5",
|
|
1287
|
+
para: "\xB6",
|
|
1288
|
+
middot: "\xB7",
|
|
1289
|
+
frac12: "\xBD",
|
|
1290
|
+
frac14: "\xBC",
|
|
1291
|
+
frac34: "\xBE",
|
|
1292
|
+
sup2: "\xB2",
|
|
1293
|
+
sup3: "\xB3",
|
|
1294
|
+
bull: "\u2022",
|
|
1295
|
+
prime: "\u2032",
|
|
1296
|
+
Prime: "\u2033",
|
|
1297
|
+
minus: "\u2212",
|
|
1298
|
+
asymp: "\u2248",
|
|
1299
|
+
ne: "\u2260",
|
|
1300
|
+
le: "\u2264",
|
|
1301
|
+
ge: "\u2265",
|
|
1302
|
+
not: "\xAC",
|
|
1303
|
+
// Arrows
|
|
1304
|
+
larr: "\u2190",
|
|
1305
|
+
uarr: "\u2191",
|
|
1306
|
+
rarr: "\u2192",
|
|
1307
|
+
darr: "\u2193",
|
|
1308
|
+
harr: "\u2194",
|
|
1309
|
+
rArr: "\u21D2",
|
|
1310
|
+
lArr: "\u21D0"
|
|
1311
|
+
};
|
|
1312
|
+
function decodeAdoEntitiesInMarkdown(text) {
|
|
1313
|
+
return text.replace(/&([a-zA-Z]+);/g, (match, name) => ADO_NAMED_ENTITIES[name] ?? match).replace(/&#x([0-9a-fA-F]+);/g, (_, hex) => String.fromCodePoint(Number.parseInt(hex, 16))).replace(/&#(\d+);/g, (_, dec) => String.fromCodePoint(Number.parseInt(dec, 10))).replaceAll("&", "&");
|
|
1314
|
+
}
|
|
1253
1315
|
function htmlToMarkdown(html) {
|
|
1254
1316
|
return NodeHtmlMarkdown.translate(escapeAnglesInCodeElements(html));
|
|
1255
1317
|
}
|
|
@@ -1257,7 +1319,7 @@ function toMarkdown(content) {
|
|
|
1257
1319
|
if (isHtml(content)) {
|
|
1258
1320
|
return htmlToMarkdown(content);
|
|
1259
1321
|
}
|
|
1260
|
-
return decodeEntitiesInMarkdownCodeSpans(content);
|
|
1322
|
+
return decodeEntitiesInMarkdownCodeSpans(decodeAdoEntitiesInMarkdown(content));
|
|
1261
1323
|
}
|
|
1262
1324
|
|
|
1263
1325
|
// src/services/command-helpers.ts
|
|
@@ -2604,7 +2666,7 @@ function createGetMdFieldCommand() {
|
|
|
2604
2666
|
if (value === null) {
|
|
2605
2667
|
process.stdout.write("\n");
|
|
2606
2668
|
} else {
|
|
2607
|
-
process.stdout.write(toMarkdown(value) + "\n");
|
|
2669
|
+
process.stdout.write(toMarkdown(value).replace(/\r?\n$/, "") + "\n");
|
|
2608
2670
|
}
|
|
2609
2671
|
if (imageOptions.enabled) {
|
|
2610
2672
|
await runImageDownload(
|