koishi-plugin-cs2-update-log 2.4.1 → 2.4.2

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.
Files changed (2) hide show
  1. package/lib/index.js +6 -2
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -614,11 +614,15 @@ function steamContentToMarkdown(input) {
614
614
  .replace(/\[img\]([\s\S]*?)\[\/img\]/gi, '')
615
615
  .replace(/\[previewyoutube=[^\]]+\]([\s\S]*?)\[\/previewyoutube\]/gi, '')
616
616
  .replace(/\[list\]|\[\/list\]|\[olist\]|\[\/olist\]/gi, '\n')
617
- .replace(/^\s*\[\*\]\s*/gim, '- ')
617
+ .replace(/[ \t]*\[\/p\][ \t]*\[\/\*\]/gi, '\n')
618
+ .replace(/^\s*\[\*\]\s*(?:\[p\]\s*)?/gim, '- ')
619
+ .replace(/\[\/\*\]/gi, '\n')
620
+ .replace(/\[p\]\s*/gi, '')
621
+ .replace(/[ \t]*\[\/p\]/gi, '\n')
618
622
  .replace(/<br\s*\/?>/gi, '\n')
619
623
  .replace(/<\/p>\s*<p>/gi, '\n\n')
620
624
  .replace(/<\/?p>/gi, '\n');
621
- output = output.replace(sectionHeadingPattern, (_, section) => `\n## [${String(section).toUpperCase()}]\n`);
625
+ output = output.replace(sectionHeadingPattern, (_, section) => `\n## [${String(section).trim().toUpperCase()}]\n`);
622
626
  sectionHeadingPattern.lastIndex = 0;
623
627
  return output
624
628
  .replace(/\n{3,}/g, '\n\n')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koishi-plugin-cs2-update-log",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "Koishi plugin for monitoring CS2 official Steam announcements and update logs.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",