azdo-cli 0.5.0-032-fix-code-generics.570 → 0.5.0-032-fix-code-generics.572
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 +5 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1234,19 +1234,19 @@ var PLT = "@@PLT@@";
|
|
|
1234
1234
|
var PGT = "@@PGT@@";
|
|
1235
1235
|
function escapeAnglesInCodeElements(html) {
|
|
1236
1236
|
return html.replace(/<code([^>]*)>([\s\S]*?)<\/code>/gi, (_, attrs, content) => {
|
|
1237
|
-
const safe = content.split("<").join(PLT).split(">").join(PGT).
|
|
1237
|
+
const safe = content.split("<").join(PLT).split(">").join(PGT).replaceAll("<", "<").replaceAll(">", ">").split(PLT).join("<").split(PGT).join(">");
|
|
1238
1238
|
return `<code${attrs}>${safe}</code>`;
|
|
1239
1239
|
});
|
|
1240
1240
|
}
|
|
1241
1241
|
function escapeAnglesInMarkdownCodeSpans(markdown) {
|
|
1242
1242
|
return markdown.replace(/(?<!`)`([^`\n]+)`(?!`)/g, (_, inner) => {
|
|
1243
|
-
const safe = inner.split("<").join(PLT).split(">").join(PGT).
|
|
1243
|
+
const safe = inner.split("<").join(PLT).split(">").join(PGT).replaceAll("<", "<").replaceAll(">", ">").split(PLT).join("<").split(PGT).join(">");
|
|
1244
1244
|
return "`" + safe + "`";
|
|
1245
1245
|
});
|
|
1246
1246
|
}
|
|
1247
1247
|
function decodeEntitiesInMarkdownCodeSpans(text) {
|
|
1248
1248
|
return text.replace(/(?<!`)`([^`\n]+)`(?!`)/g, (_, inner) => {
|
|
1249
|
-
const decoded = inner.
|
|
1249
|
+
const decoded = inner.replaceAll("<", "<").replaceAll(">", ">");
|
|
1250
1250
|
return "`" + decoded + "`";
|
|
1251
1251
|
});
|
|
1252
1252
|
}
|
|
@@ -5095,10 +5095,10 @@ async function addWorkItemRelation(context, cred, type, id1, id2) {
|
|
|
5095
5095
|
const relType = await resolveRelationType(context, cred, type);
|
|
5096
5096
|
const workItem = await getWorkItemWithRelations(context, cred, id1);
|
|
5097
5097
|
const targetUrl = `https://dev.azure.com/${encodeURIComponent(context.org)}/_apis/wit/workItems/${id2}`;
|
|
5098
|
-
const
|
|
5098
|
+
const exists = (workItem.relations ?? []).some(
|
|
5099
5099
|
(r) => r.rel === relType.referenceName && parseTargetId(r.url) === id2
|
|
5100
5100
|
);
|
|
5101
|
-
if (
|
|
5101
|
+
if (exists) {
|
|
5102
5102
|
return { status: "already_exists", type: relType.name, referenceName: relType.referenceName, id1, id2 };
|
|
5103
5103
|
}
|
|
5104
5104
|
const patchUrl = buildWorkItemUrl2(context, id1);
|