@docubook/cli 0.2.7 → 0.2.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docubook/cli",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "DocuBook CLI tool that helps you initialize, update, and deploy documentation directly from your terminal.",
5
5
  "type": "module",
6
6
  "files": [
@@ -60,8 +60,11 @@ async function _fetchChangelogFromGitHub(version) {
60
60
  function _extractVersionSection(changelogText, version) {
61
61
  if (!changelogText) return null;
62
62
  const lines = changelogText.split(/\r?\n/);
63
- // Look for headings that include the version (e.g. "## v1.2.3" or "## 1.2.3")
64
- const headerRe = new RegExp(`^#{1,3}\\s*(?:v)?${version.replace(/\./g, "\\.")}(?:\\b|\\D)`, "i");
63
+ // Look for level-2 headings that include the version
64
+ // Matches patterns like "## cli-v0.2.7", "## v0.2.7", or "## 0.2.7"
65
+ // Use exactly "##" (level 2), not "###" or other levels
66
+ const versionEscaped = version.replace(/\./g, "\\.");
67
+ const headerRe = new RegExp(`^##\\s*(?:cli-)?v?${versionEscaped}(?:\\b|\\D)`, "i");
65
68
  let start = -1;
66
69
  for (let i = 0; i < lines.length; i++) {
67
70
  if (headerRe.test(lines[i])) {