@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 +1 -1
- package/src/cli/program.js +5 -2
package/package.json
CHANGED
package/src/cli/program.js
CHANGED
|
@@ -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
|
|
64
|
-
|
|
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])) {
|