From 2df97bbcac4fbfafe0b0520418ac1d780d57770d Mon Sep 17 00:00:00 2001 From: Jose Jimenez Date: Sun, 15 Feb 2026 20:13:02 +0100 Subject: [PATCH] Fix parsing of numbers with plus sign --- src/components/HarmonicaTabGenerator.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/HarmonicaTabGenerator.jsx b/src/components/HarmonicaTabGenerator.jsx index 75ff00c..12eaa45 100644 --- a/src/components/HarmonicaTabGenerator.jsx +++ b/src/components/HarmonicaTabGenerator.jsx @@ -32,7 +32,7 @@ const SVG_CONFIG = { /** * Parse input text and identify tab lines vs annotation lines - * Adds + signs to positive numbers in tab lines + * Adds + signs to positive numbers in tab lines (if not already present) * Preserves empty lines for spacing */ const parseInput = (text) => { @@ -42,13 +42,13 @@ const parseInput = (text) => { // Check if line is empty const isEmpty = line.trim().length === 0; - // Tab lines contain only numbers, spaces, minus signs, and bend markers + // Tab lines contain only numbers, spaces, +/- signs, and bend markers const isTabLine = - /^[\s\d\-'"`'']+$/.test(line.trim()) && line.trim().length > 0; + /^[\s\d\+\-'"`'']+$/.test(line.trim()) && line.trim().length > 0; let processedContent = line; - // Add + signs to positive numbers in tab lines + // Add + signs to positive numbers in tab lines (only if not already present) if (isTabLine) { processedContent = line.replace( /(\s|^)(\d+)(['"`'']?)/g,