Closed Gonzalo2683 closed 2 years ago
Hey @Gonzalo2683. Thanks for following up.
I might think about whether to loosen up the chord parsing by discarding leading or trailing whitespace.
For the time being you can work around it in two ways:
const parsedChord = Chord.parse(item.chords.trim())
ChordSheetJS.ChordSheetParser({ preserveWhitespace: false })
Please let me know if this is helpful.
Thanks, I think what you mention would be enough, I'm still learning how the API works, I only mentioned it out of doubt that those blank spaces influence the final alignment of the chords on the lyrics, but apparently it doesn't.
When using new ChordSheetJS.ChordSheetParser() and traversing its lines to process chords, some chord values cannot be parsed.
You could also transform from
ChordSheetParser
toChordProParser
similar to what you do with theconvertChordSheetToChordPro
function in chordFiddle and the problem would be avoided, but that missing hole would remain.I don't know if this is by design, or if it has a problem, based on the chordFiddle example, the following can be shown:
With:
"chordsheetjs": "^6.3.0"
Starting from:
The parsed chord value is null, because of apparently having trailing whitespace.
Here's another iteration where the chord has no whitespace