@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alleyinteractive/changelog-extractor",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "description": "Parse and extract structured information from Keep a Changelog formatted changelogs",
6
6
  "main": "src/parser.js",
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 or ## v1.14.0 - 2024-04-29
98
- const versionRegex = /^##\s+v?(\d+\.\d+\.\d+(?:-[^\s]+)?)\s*(?:-\s*(.*))?$/
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