@alleyinteractive/changelog-extractor 0.4.0 → 0.4.1
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 +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/parser.js +3 -2
package/package.json
CHANGED
package/src/parser.js
CHANGED
|
@@ -94,8 +94,9 @@ export function parseChangelog(changelogContent, version = null) {
|
|
|
94
94
|
let currentSectionContent = []
|
|
95
95
|
let generalContent = [] // Content without section headers
|
|
96
96
|
|
|
97
|
-
// Regex to match version headers: ## v1.14.0
|
|
98
|
-
const versionRegex =
|
|
97
|
+
// Regex to match version headers: ## v1.14.0, ## [1.14.0] - 2024-04-29, or ## 2024-04-29
|
|
98
|
+
const versionRegex =
|
|
99
|
+
/^##\s+\[?v?(\d+\.\d+\.\d+(?:-[^\s\]]+)?|\d{4}-\d{2}-\d{2})\]?\s*(?:-\s*(.*))?$/
|
|
99
100
|
// Regex to match section headers: ### Added, ### Changed, etc.
|
|
100
101
|
const sectionRegex = /^###\s+(.+)$/
|
|
101
102
|
|