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

better error handling on \n\n inside a syllable in gabc #1111

Closed
eroux opened this issue May 18, 2016 · 14 comments
Closed

better error handling on \n\n inside a syllable in gabc #1111

eroux opened this issue May 18, 2016 · 14 comments
Assignees

Comments

@eroux
Copy link
Contributor

eroux commented May 18, 2016

gregorio could replace (\n|\r)+ with \n inside syllables when outputing GregorioTeX, see this thread

@henryso
Copy link
Contributor

henryso commented May 18, 2016

Should it not replace multiple whitespace (\t| |\n|\r)+ with a single blank space?

@rpspringuel
Copy link
Contributor

With the exception of two line breaks in a row (which is treated as equivalent to \par), TeX already treats multiple white space characters as a single white space character.

@henryso
Copy link
Contributor

henryso commented May 18, 2016

Got it, thanks.

@pcouderc12
Copy link

Is it a problem to ignore any "special" character (under "space") in gabc ?

@henryso
Copy link
Contributor

henryso commented May 18, 2016

I don't think it's a good idea to be over-zealous with this change. There's too much chance of breaking something outside gabc (present or future) that uses a control character for its operation.

@pcouderc12
Copy link

1-Most problems come from (\t| |\n|\r) as you state it.
2- I cannot imagine a soon existing (or future) code using these characters (or ANY "special" character) in a meaningful state in gabc source.
3- Problems with non printable characters are very difficult to detect. So I "vote" for replacing any special character....

My problem was created the following way : I wanted to create a new version of Pange Lingua. I did start from a classical version, and used https://bbloomf.github.io/jgabc/transcriber.html to get the accentuated text and change the music, and got the problem with this result. It was difficult to find it. Sed ego non sum Lumen...

@eroux
Copy link
Contributor Author

eroux commented May 19, 2016

What do you mean by "special character"? This is pretty unclear to me... What other special characters do you see?

@pcouderc12
Copy link

Good old special characters : U+0000 à U+001F
None of them would be present in gabc after %% (except \n \r...) and
none of them makes sense. If they occurs it is a corruption of the file
but may very difficult to detect.
But this is not an important issue.

On 05/19/2016 09:38 AM, Elie Roux wrote:

What do you mean by "special character"? This is pretty unclear to
me... What other special characters do you see?


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#1111 (comment)

@henryso
Copy link
Contributor

henryso commented May 19, 2016

@rpspringuel It seems like {newline}{blank}{newline} is also treated as \par, so I think the pattern for replacement should be (\n|\r)(\t| |\n|\r)*.

@jakubjelinek
Copy link
Contributor

But can't somebody have in between and arbitrary TeX stuff, including \par, \n\n etc.? Changing that in any way would be IMNSHO undesirable?

@eroux
Copy link
Contributor Author

eroux commented May 19, 2016

Maybe a good option would be to handle that on the TeX side, by just ignoring new lines... users who do not want this behavior could change it easily

@henryso
Copy link
Contributor

henryso commented May 19, 2016

The <v></v> stuff and <alt></alt> stuff can be handled separately from plain text and the text between style tags. I think it's best to leave the verbose and above lines text alone and only eat repeated newlines for lyric text everywhere else.

@eroux
Copy link
Contributor Author

eroux commented May 19, 2016

Good idea yes

@rpspringuel
Copy link
Contributor

It seems like {newline}{blank}{newline} is also treated as \par, so I think the pattern for replacement should be (\n|\r)(\t| |\n|\r)*.

While I didn't think about it, given that TeX automatically ignores blanks spaces at the beginning of a line, that does make sense.

@henryso henryso self-assigned this May 19, 2016
henryso added a commit to henryso/gregorio that referenced this issue May 19, 2016
henryso added a commit to henryso/gregorio-test that referenced this issue May 19, 2016
@henryso henryso closed this as completed May 20, 2016
rpspringuel added a commit to rpspringuel/gregorio that referenced this issue May 20, 2016
* commit '22e725b90f107583dfe9d51f7ec93a6e1852b8e5':
  Collapsed strings of whitespace that start with a newline to a single space. Fixes gregorio-project#1111.
rpspringuel added a commit to rpspringuel/gregorio that referenced this issue May 21, 2016
* release-4.2:
  Fixing old bar spacing algorithm
  Collapsed strings of whitespace that start with a newline to a single space. Fixes gregorio-project#1111.
rpspringuel added a commit to rpspringuel/gregorio-test that referenced this issue May 22, 2016
* release-4.2:
  Accepting corrected results
  Added a test for whitespace collapsing. Tests gregorio-project/gregorio#1111.
  New test to show interaction between mora shift and old bar spacing algorithm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants