fix: fix parsing of mercurial in dragon-item-parser
All checks were successful
Dragon Item Parser CI / build-and-test (push) Successful in 13s
pipeline / lint-and-format (push) Successful in 4m46s
pipeline / build-and-push-images (push) Successful in 2m19s

This commit is contained in:
2026-04-27 13:31:18 +02:00
parent af51d61e0c
commit 7712abe3f0
2 changed files with 57 additions and 4 deletions

View File

@@ -544,11 +544,15 @@ function parseEffects(description: string): ItemEffect[] {
const activeMatch = line.match(/^<active>([^<]*)<\/active>(.*)$/i)
if (activeMatch) {
const remainingContent = activeMatch[2].trim()
// Skip lines that are just "ACTIVE" labels (like "(0s)" cooldown indicators)
const effectName = activeMatch[1].trim()
if (effectName.toUpperCase() === 'ACTIVE' && remainingContent.match(/^\([^)]*\)\s*$/)) {
// This is just a cooldown label, skip it
continue
// Skip lines that are just "ACTIVE" labels
// This includes: standalone "ACTIVE", or "ACTIVE" followed by cooldown like "(0s)"
if (effectName.toUpperCase() === 'ACTIVE') {
// Skip if it's just "ACTIVE" with no other content, or just a cooldown indicator
if (!remainingContent || remainingContent.match(/^\([^)]*\)\s*$/)) {
continue
}
}
if (!remainingContent) {