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

Added normalize-space to gloss value #721

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Added normalize-space to gloss value #721

wants to merge 3 commits into from

Conversation

GusRiva
Copy link
Member

@GusRiva GusRiva commented Dec 12, 2024

Dealing with #717

What I did:

Found the place where the content of gloss was created and normalized the whitespace

How I tested:

  • Add whitespace at the beginning or ending of a gloss in /TEI/P5/Source/Specs
  • Build the guidelines (using this branch of the stylesheets) and see if the whitespaces are normalized

Example test:

Change /TEI/P5/Source/Specs/ab.xml (line 5) to:
<gloss versionDate="2005-01-14" xml:lang="en"> anonymous block </gloss>

Old output (with dev branch):

<ab> ( anonymous block ) contains any ...

New output from this branch:

<ab> (anonymous block) contains any ...

@GusRiva GusRiva added this to the Release 7.58.0 milestone Dec 12, 2024
@GusRiva GusRiva linked an issue Dec 12, 2024 that may be closed by this pull request
@GusRiva
Copy link
Member Author

GusRiva commented Dec 12, 2024

These changes required some modifications in the test files.

As you can see, now this normalizes the whitespace of gloss in all ODD transformations. I actually think this is a better output in all the places where it happens.

However, if we just want to change this in the html guidelines and not as a general rule for gloss, we need to find a different place to do the change. I think this general solution is probably better, but just in case.

Copy link
Member

@sydb sydb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

  • I examined the 1-line code change, looks good
  • I spot-checked a few expected results, seemed fine
  • I ran make test2P on my machine — all tests pass
  • I ran make test in a Docker container on my machine — all tests pass

So I am in favor of merging this ASAR.

@sydb
Copy link
Member

sydb commented Dec 18, 2024

BTW, @GusRiva , in my little brain the important place to effect this change was in the RELAX NG output, where some tools just report whatever whitespace is there, thus sometimes giving ugly results.

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

Successfully merging this pull request may close these issues.

<gloss> (and presumably <desc>) content should be space-normalized
3 participants