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

Remove dash from illegal characters. #6300

Merged
merged 32 commits into from
May 6, 2020
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2b7fad5
Remove dash from illegal characters. Fix #6295 #6257 #6252
dextep Apr 16, 2020
f332e42
Update bibtexkey incompatible characters.
dextep Apr 17, 2020
38687aa
Add missing abbreviated journal names (#6292)
mayrmt Apr 16, 2020
feb6709
Change in CHANGELOG.md described.
dextep Apr 17, 2020
23d9720
Revert "Add missing abbreviated journal names (#6292)"
dextep Apr 17, 2020
a90ac60
Update CHANGELOG.md
dextep Apr 17, 2020
ed42ac1
Update CHANGELOG.md
dextep Apr 17, 2020
6fc9645
Renamed 'KEY_UNWANTED_CHARACTERS' to 'KEY_CHARACTERS_CAUSING_PARSING_…
dextep Apr 17, 2020
00f8c92
Merged illegal `KEY_ILLEGAL_CHARACTERS` and disallowed `KEY_CHARACTER…
dextep Apr 22, 2020
e39cca3
Adapted the tests according to code updates.
dextep Apr 23, 2020
471ec0e
Removed 'enforceLegalKey'.
dextep Apr 28, 2020
19e0879
Removed "Enforce legal characters in BibTeX keys" option in the prefe…
dextep May 1, 2020
2161cd1
Changes related to the review.
dextep May 2, 2020
ae8b183
Remove dash from illegal characters. Fix #6295 #6257 #6252
dextep Apr 16, 2020
08257ff
Update bibtexkey incompatible characters.
dextep Apr 17, 2020
d0e5241
Change in CHANGELOG.md described.
dextep Apr 17, 2020
8a510e3
Revert "Add missing abbreviated journal names (#6292)"
dextep Apr 17, 2020
d7d5ac7
Update CHANGELOG.md
dextep Apr 17, 2020
dda3259
Update CHANGELOG.md
dextep Apr 17, 2020
7362457
Renamed 'KEY_UNWANTED_CHARACTERS' to 'KEY_CHARACTERS_CAUSING_PARSING_…
dextep Apr 17, 2020
fe43020
Merged illegal `KEY_ILLEGAL_CHARACTERS` and disallowed `KEY_CHARACTER…
dextep Apr 22, 2020
aae2b0e
Adapted the tests according to code updates.
dextep Apr 23, 2020
4807493
Removed 'enforceLegalKey'.
dextep Apr 28, 2020
0b1ca1a
Removed "Enforce legal characters in BibTeX keys" option in the prefe…
dextep May 1, 2020
d64b911
Changes related to the review.
dextep May 2, 2020
6032766
Changes related to the review.
dextep May 3, 2020
995ff60
Merge branch 'remove-dash-from-illegal-chars' of https://github.com/d…
dextep May 3, 2020
4d37195
Merge remote-tracking branch 'upstream/master' into remove-dash-from-…
dextep May 4, 2020
3f5b2e5
Fix checkstyle.
dextep May 5, 2020
6db1344
Changes related to the review.
dextep May 5, 2020
c1ec4ad
Changes related to the review.
dextep May 6, 2020
cfeea59
Changes related to the review.
dextep May 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class BibtexKeyGenerator extends BracketedPattern {
*/
public static final String APPENDIX_CHARACTERS = "abcdefghijklmnopqrstuvwxyz";
private static final Logger LOGGER = LoggerFactory.getLogger(BibtexKeyGenerator.class);
private static final String KEY_ILLEGAL_CHARACTERS = "{}(),\\\"-#~^:'`ʹ";
private static final String KEY_ILLEGAL_CHARACTERS = "{}(),\\\"#~^:'`ʹ";
private static final String KEY_UNWANTED_CHARACTERS = "{}(),\\\"-";
Copy link
Member

Choose a reason for hiding this comment

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

Why didn't you remove the - it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to the recommendation in the README, I thought it was a mistake to include a dash in illegal signs, not those not recommended.

Some characters should not be used in bibtexkey as they are not compatible or not recommended: { } ( ) , \ " - # ~ ^ : '

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@koppor so should i remove dash from unwanted characters and make update on READEME file?

Copy link
Member

Choose a reason for hiding this comment

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

Remove it from illegal, but keep it in unwanted.

Copy link
Member

Choose a reason for hiding this comment

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

I checked the usage of KEY_UNWANTED_CHARACTERS.

The code comment reads as follows:

// User doesn't want us to enforce legal characters. We must still look
// for whitespace and some characters such as commas, since these would
// interfere with parsing:

Thus, the KEY_UNWANTED_CHARACTERS clearly is a subset of KEY_ILLEGAL_CHARACTERS. Not sure, whether KEY_ILLEGAL_CHARACTERS makes sense at all. Maybe because of tool interopability.

I see three options:

A) Remove KEY_UNWANTED_CHARACTERS completely - and also the preference for it.
B) Set KEY_UNWANTED_CHARACTERS to a minimum - as indicated in the comment. I would propose {}" since these are the characters causing issues at parsing. I would not add space since this did not cause any issues until now (at list that I am aware of)
C) Just remove - from KEY_UNWANTED_CHARACTERS

Please do option B). Please rename KEY_UNWANTED_CHARACTERS to KEY_CHARACTERS_CAUSING_PARSING_ERRORS. Please add a comment above that this is a subset of KEY_ILLEGAL_CHARACTERS.

private final AbstractBibtexKeyPattern citeKeyPattern;
private final BibDatabase database;
Expand Down