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

Fix Normalize pages formatter not replacing dashes #7243

Merged
merged 16 commits into from
Jan 4, 2021

Conversation

Siedlerchr
Copy link
Member

@Siedlerchr Siedlerchr commented Dec 25, 2020

Fixes #7239

  • Change in CHANGELOG.md described (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.

@Siedlerchr
Copy link
Member Author

For devCall:


I would suggest we weaken the regex to follow the biblatex def: (2.2.1)

    A range is something optionally followed by one or more dashes optionally followed by some non-dash (e.g.5--7).


@koppor koppor changed the title Fix Normalize pages fornatter not replacing dashes Fix Normalize pages formatter not replacing dashes Dec 28, 2020
@koppor
Copy link
Member

koppor commented Dec 28, 2020

As a follow-up to #1013, I added UnprotectTermsFormatter. I was not sure about the naming, because it is not an opposite one (#920 (comment)). UnfreezeAllWords was the old proposal.

The discussion continued at #920 (comment)

@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Dec 29, 2020
return value;
value = EM_EN_DASH_PATTERN.matcher(cleanValue).replaceAll("-")
.replaceAll("[ ]*[-]+[ ]*", "--");
return unprotectTermsFormatter.format(value.trim());
Copy link
Member

@tobiasdiez tobiasdiez Dec 29, 2020

Choose a reason for hiding this comment

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

I'm also not sure if I-X is correct or I--X for roman page numbers.

Copy link
Member

Choose a reason for hiding this comment

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

Result of test-driven-development 😇. I will think more about it now.

Copy link
Member

Choose a reason for hiding this comment

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

I'm also not sure if I-X is correct or I--X for roman page numbers.

This reads more as a page range, too. Roman 9 is written IX (and not I-X), isn't it?

@tobiasdiez tobiasdiez added the status: changes required Pull requests that are not yet complete label Dec 29, 2020
@koppor
Copy link
Member

koppor commented Dec 29, 2020

Regarding the case pages 1-50, I was unsure. I opted to also to reformat them.

@koppor koppor removed the status: changes required Pull requests that are not yet complete label Dec 29, 2020
@calixtus calixtus merged commit eca13dd into master Jan 4, 2021
@calixtus calixtus deleted the fixNormalizePagesFormatter branch January 4, 2021 16:37
Siedlerchr added a commit that referenced this pull request Jan 5, 2021
…dtask

* upstream/master:
  Fix typo for small pi (#7296)
  Fix Normalize pages formatter not replacing dashes (#7243)
  Simplify LO connection and fix threading errors (#7271)
  Fix for issue 7287 (#7290)

# Conflicts:
#	src/main/resources/l10n/JabRef_en.properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export to MODS format fails (wrong dash in pages field)
5 participants