Skip to content

Support for $\backslash$ in file paths#9906

Merged
Siedlerchr merged 2 commits into
mainfrom
enable-mendeley-path-parsing
May 16, 2023
Merged

Support for $\backslash$ in file paths#9906
Siedlerchr merged 2 commits into
mainfrom
enable-mendeley-path-parsing

Conversation

@koppor

@koppor koppor commented May 15, 2023

Copy link
Copy Markdown
Member

Fixes https://discourse.jabref.org/t/mendeley-bib-import-with-linked-files/3470. Fixes https://github.com/JabRef/jabref-issue-melting-pot/issues/178.

### Compulsory checks
- [ ] Change in `CHANGELOG.md` described in a way that is understandable for the average user (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 developer's documentation](https://devdocs.jabref.org/): Is the information available and up to date? If not, I outlined it in this pull request.
- [ ] [Checked documentation](https://docs.jabref.org/): Is the information available and up to date? If not, I created an issue at <https://github.com/JabRef/user-documentation/issues> or, even better, I submitted a pull request to the documentation repository.

@koppor koppor mentioned this pull request May 15, 2023
5 tasks
if (value == null) {
this.value = null;
} else {
this.value = value.replace("$\\backslash$", "\\");

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.

Why not call the latex 2 Unicode formatter to capture more cases

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I would need to rewrite the logic of the latextounicode formatter:

grafik

Expected :[ParsedFileField{description='', link='C:/Users/XXXXXX/AppData/Local/Mendeley Ltd./Mendeley Desktop/Downloaded/Brown - 2017 - Physical test methods for elastomers.pdf', fileType='pdf'}]
Actual :[ParsedFileField{description='', link='Cbackslash{}{', fileType='}{/}Users/XXXXXX/AppData/Local/Mendeley Ltd./Mendeley Desktop/Downloaded/Brown - 2017 - Physical test methods for elastomers.pdf'}]

Expected :[ParsedFileField{description='test:;', link='wei2005ahp.pdf', fileType='PDF'}]
Actual :[ParsedFileField{description='test ', link='wei2005ahp.pdf', fileType='PDF'}]

Should I commit nevertheless?

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 would go with the simple solution first and leave this whooe latex removing for later

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.

One would probaly treat each path segment separately by the formatter

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In the original example, there were no umlauts there. I was thinking: better a quick fix than some effort on catching the special cases 😇

Siedlerchr
Siedlerchr previously approved these changes May 16, 2023
Comment thread src/main/java/org/jabref/logic/importer/util/FileFieldParser.java
@Siedlerchr Siedlerchr merged commit 228ce99 into main May 16, 2023
@Siedlerchr Siedlerchr deleted the enable-mendeley-path-parsing branch May 16, 2023 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants