6ba513c530
Fixes two parsing issues with inventory items: 1. Items with commas in parenthetical descriptions were incorrectly split into multiple items. For example: "Potato (Cursed, Sexy, Your Mum & Dick, Etc)" would become 3-4 separate items instead of one. 2. AI sometimes wraps item lists in square brackets, which should be stripped. For example: "[Sword, Shield]" should parse as ["Sword", "Shield"] Solution: - Enhanced parseItems() to track parenthesis depth during parsing - Only split on commas that are OUTSIDE parentheses - Strip wrapping square brackets before parsing - Commas inside parentheses are now preserved as part of the item name - Maintains backward compatibility with existing items Implementation: - Pre-processing: strip wrapping brackets if present - Two-pass parsing: first collapses newlines in parentheses (existing), then smart comma splitting (new) - Similar approach to existing newline handling logic Examples: - "Sword, Shield" → ["Sword", "Shield"] (unchanged) - "Item (tag1, tag2), Sword" → ["Item (tag1, tag2)", "Sword"] (fixed) - "[Sword, Shield]" → ["Sword", "Shield"] (fixed) Fixes: Items with commas split into multiple items