-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add truncate as a BibTex key modifier #6427
Add truncate as a BibTex key modifier #6427
Conversation
This reverts commit 19fbbb3 The tests were placed in the wrong file.
src/main/java/org/jabref/logic/bibtexkeypattern/BracketedPattern.java
Outdated
Show resolved
Hide resolved
Otherwise looks already good as starting point |
I missed how RegexFormatter is implemented, I'll just mimic that and it shouldn't be a problem. |
src/main/java/org/jabref/logic/formatter/minifier/TruncateFormatter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jabref/logic/formatter/minifier/TruncateFormatter.java
Outdated
Show resolved
Hide resolved
…atter.java Co-authored-by: Christoph <[email protected]>
…dSMPHz27/jabref into fix-for-issue-3915 � Conflicts: � src/main/java/org/jabref/logic/formatter/minifier/TruncateFormatter.java
In a nutshell.
|
When I try to import a file from an URL using a pattern that creates a java.nio.file.FileSystemException. The directory cannot be created but the file is still downloaded. Should I try to fix that as part of this pull request as well? |
Change to use a precompiled pattern for matching 'truncateN'
Change to use a precompiled pattern for matching 'truncateN'
…dSMPHz27/jabref into fix-for-issue-3915
your changes look so far, is this ready then? |
# Conflicts: # src/test/java/org/jabref/logic/bibtexkeypattern/BracketedPatternTest.java
Yes. The last conflicts should be resolved now. |
The last change (change of test names) can be removed but it seems more consistent with the guidelines? |
For me it's fine. For external contributors we have the rule that at least two developers should review a PR. So when a second dev gives his okay, it's ready for merge! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me, so I'll merge now. Thanks for your contribution - we look forward to your next PR!
* upstream/master: (50 commits) Keep group pane size when resizing window (#6180) (#6423) Changelog: Fix missing citation for biblatex-mla Update AUTHORS Check duplicate DOI (#6333) Fix missing citation for biblatex-mla Change EasyBind dependency (#6480) Add testing of latest dev version as mandatory Squashed 'src/main/resources/csl-styles/' changes from 5dad23d..586e0b8 Fix libre office connection and other progress dialogs (#6478) Fix clear year and month field when converting to biblatex (#6434) Add truncate as a BibTex key modifier (#6427) Add new authors (not all - they need more work) Remove empty line Add simple Unit Tests for #6207 (#6240) Enforce LeftCurly rule (#6452) Implement task progress indicator (and dialog) in the toolbar (#6443) Consider empty brackets Changelog update Added a test Fixed brackets in regular expressions ...
e9fd2027de Add Medicine Publishing Styles (#6434) cae128f35f Create Bristol University Press (#6356) 74b4af3b82 Create internet-archaeology.csl (#6357) ee7ece480b Add Bio-Protocol style (#6429) 9a455efcee Create archives-of-medical-research.csl (#6415) e91aba46fc Remove some bursa-uludag styles (#6423) 03f3962657 Update offa.csl (#6428) 95dc9b9f5a Update journal-of-neolithic-archaeology.csl (#6427) a4e6c7f477 Update the-university-of-winchester-harvard.csl (#6374) c0bf10647a add manuscript formatting to ASA (#6387) 3a673a564a Update universite-de-sherbrooke-histoire.csl (#6392) 0c48c7289e Update chemistry-education-research-and-practice.csl (#6397) 51f718a7b9 Update journal-of-endodontics.csl (#6409) 51e419051f Update presses-universitaires-de-rennes.csl (#6413) git-subtree-dir: buildres/csl/csl-styles git-subtree-split: e9fd2027de4e2355f3244ac662960467e225774d
Fixes #3915. Adds a truncate modifier to the available BibTex key modifiers. For "A Title" the bracketed pattern
[title:truncate3]
produces the result "A T".truncateN
([title:truncate5]
) to mimic the pattern ofauthN
etc.Remaining
Things I am not sure about
truncate
be a formatter(org.jabref/logic/formatter)? Currently, formatters does not accept argumentstruncate
. E.g., for "A Title",[title:truncate3]
will lead to thebibtexkey
"AT"BracketedPatternTest
inorg.jabref/logic/util/
. Is there a correct location for theBracketedPatternTest
?Others