koishi-plugin-minecraft-notifier 1.10.1 → 1.10.3

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.
@@ -0,0 +1 @@
1
+ export declare function escapeForXaml(text: string): string;
package/lib/index.cjs CHANGED
@@ -540,6 +540,11 @@ async function upsertFileToGitCode(ctx, owner, repo, path3, content, message, to
540
540
  });
541
541
  }
542
542
 
543
+ // src/helper/xaml-helper.ts
544
+ function escapeForXaml(text) {
545
+ return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;").replace(/\\/g, "\\\\");
546
+ }
547
+
543
548
  // src/xaml-generator.ts
544
549
  function generateXaml(summary, version) {
545
550
  const orderedCategories = [
@@ -564,7 +569,7 @@ function generateXaml(summary, version) {
564
569
  <TextBlock
565
570
  Margin="${margin}"
566
571
  Foreground="{DynamicResource ColorBrush1}"
567
- Text="- ${(0, import_autocorrect_node.format)(msg)}" />`;
572
+ Text="- ${escapeForXaml((0, import_autocorrect_node.format)(msg))}" />`;
568
573
  }
569
574
  for (let j = 0; j < subcategories.length; j++) {
570
575
  const sub = subcategories[j];
@@ -573,7 +578,7 @@ function generateXaml(summary, version) {
573
578
  Margin="0,0,0,4"
574
579
  FontSize="14"
575
580
  Foreground="{DynamicResource ColorBrush3}"
576
- Text="${sub.emoji} ${sub.subcategory}" />`;
581
+ Text="${sub.emoji} ${escapeForXaml((0, import_autocorrect_node.format)(sub.subcategory))}" />`;
577
582
  for (let k = 0; k < sub.items.length; k++) {
578
583
  const msg = sub.items[k];
579
584
  const margin = k === sub.items.length - 1 && j === subcategories.length - 1 ? "" : 'Margin="0,0,0,2"';
@@ -581,7 +586,7 @@ function generateXaml(summary, version) {
581
586
  <TextBlock
582
587
  ${margin}
583
588
  Foreground="{DynamicResource ColorBrush1}"
584
- Text=" - ${(0, import_autocorrect_node.format)(msg)}" />`;
589
+ Text=" - ${escapeForXaml((0, import_autocorrect_node.format)(msg))}" />`;
585
590
  }
586
591
  if (j < subcategories.length - 1) {
587
592
  contentXaml += `
@@ -592,7 +597,7 @@ function generateXaml(summary, version) {
592
597
  categoriesXaml += `
593
598
  <!-- ${categoryTitle}\u5361\u7247 -->
594
599
  <local:MyCard
595
- Title="${categoryTitle}"
600
+ Title="${escapeForXaml((0, import_autocorrect_node.format)(categoryTitle))}"
596
601
  Margin="0,5,0,10"
597
602
  CanSwap="True"
598
603
  IsSwapped="${["new_features", "improvements", "balancing"].includes(category) ? "False" : "True"}"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-minecraft-notifier",
3
3
  "description": "A Minecraft new version notification plugin, also featuring a PCL homepage.",
4
- "version": "1.10.1",
4
+ "version": "1.10.3",
5
5
  "main": "lib/index.cjs",
6
6
  "typings": "lib/index.d.ts",
7
7
  "type": "module",
@@ -16,8 +16,9 @@
16
16
  "plugin"
17
17
  ],
18
18
  "scripts": {
19
- "lint": "eslint ./src --ext .ts",
20
- "lint:fix": "eslint ./src --ext .ts --fix",
19
+ "lint": "npx oxlint ./src",
20
+ "lint:fix": "npx oxlint ./src --fix",
21
+ "fmt": "npx oxfmt ./src",
21
22
  "build": "node esbuild.config.js && tsc --emitDeclarationOnly",
22
23
  "release": "semantic-release"
23
24
  },
@@ -29,24 +30,20 @@
29
30
  "@semantic-release/changelog": "^6.0.3",
30
31
  "@semantic-release/commit-analyzer": "^13.0.1",
31
32
  "@semantic-release/git": "^10.0.1",
32
- "@semantic-release/npm": "^13.1.1",
33
+ "@semantic-release/npm": "^13.1.2",
33
34
  "@semantic-release/release-notes-generator": "^14.1.0",
34
- "@trivago/prettier-plugin-sort-imports": "^5.2.2",
35
35
  "@types/turndown": "^5.0.6",
36
36
  "conventional-changelog-conventionalcommits": "^9.1.0",
37
- "esbuild": "^0.25.11",
37
+ "esbuild": "^0.27.1",
38
38
  "esbuild-plugin-yaml": "^0.0.1",
39
- "eslint": "^9.38.0",
40
- "eslint-config-prettier": "^10.1.8",
41
- "eslint-plugin-prettier": "^5.5.4",
42
- "prettier": "^3.6.2",
43
- "semantic-release": "^25.0.1",
44
- "typescript": "^5.9.3",
45
- "typescript-eslint": "^8.46.2"
39
+ "oxfmt": "^0.16.0",
40
+ "oxlint": "^1.31.0",
41
+ "semantic-release": "^25.0.2",
42
+ "typescript": "^5.9.3"
46
43
  },
47
44
  "dependencies": {
48
45
  "autocorrect-node": "^2.14.0",
49
- "axios": "^1.12.2",
46
+ "axios": "^1.13.2",
50
47
  "cheerio": "^1.1.2",
51
48
  "turndown": "^7.2.2"
52
49
  }