Skip to content

Fix Normalize pages formatter not replacing dashes#7243

Merged
calixtus merged 16 commits into
masterfrom
fixNormalizePagesFormatter
Jan 4, 2021
Merged

Fix Normalize pages formatter not replacing dashes#7243
calixtus merged 16 commits into
masterfrom
fixNormalizePagesFormatter

Conversation

@Siedlerchr

@Siedlerchr Siedlerchr commented Dec 25, 2020

Copy link
Copy Markdown
Member

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
Copy Markdown
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

koppor commented Dec 28, 2020

Copy link
Copy Markdown
Member

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
Comment thread src/main/java/org/jabref/logic/formatter/casechanger/UnprotectTermsFormatter.java Outdated
return value;
value = EM_EN_DASH_PATTERN.matcher(cleanValue).replaceAll("-")
.replaceAll("[ ]*[-]+[ ]*", "--");
return unprotectTermsFormatter.format(value.trim());

@tobiasdiez tobiasdiez Dec 29, 2020

Copy link
Copy Markdown
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.

Copy link
Copy Markdown
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
Copy Markdown
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

koppor commented Dec 29, 2020

Copy link
Copy Markdown
Member

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