Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserving whitespace and comma parsing error with ChordPro parser #1409

Open
aonghas opened this issue Oct 24, 2024 · 2 comments
Open

Preserving whitespace and comma parsing error with ChordPro parser #1409

aonghas opened this issue Oct 24, 2024 · 2 comments

Comments

@aonghas
Copy link

aonghas commented Oct 24, 2024

Hi there,

I'm trying to parse the following ChordPro and I'm getting a weird output:

{comment: Intro}
[|] [B]              [|] [Bsus]        [|] [B]              [|] [Bsus]         [|]
[|] [B]              [|] [Bsus]        [|] [G#m7]       [|] [F#(4)]       [|]

{comment: Verse 1}
I've come [B]  for a day [C#m]  of fun
I've come [G#m7]  for the ho       [F#(4)]- le in one [E]
All I want [B]  is to cel     [C#m]- ebrate with you [G#m7]      [F#(4)]      [E]

Gives me this output with the HTML table formatter:
image

Issues I've noticed:

  • The whitespace in the intro isn't preserved (the lyrics pairs are just empty instead of something like  
  • The whitespaces in the second and third lines are generating erroneous comma , characters for some reason...

Is this able to be fixed? I'm happy to investigate myself if you can give me some pointers of where to look...

Thanks!

@aonghas
Copy link
Author

aonghas commented Oct 24, 2024

An additional observation I've seen with the comma issue is when there are extra spaces after the lyrics and before another chord, like ho [F#(4)]. The other way around just collapses white space, ie. [F#(4)] ho

@aonghas
Copy link
Author

aonghas commented Oct 25, 2024

After doing some more digging, I think I've narrowed the issue down to the parser rather than the formatter. In the parser object, I see the following:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant