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

Faulty underscore escaping in URLs #4

Closed
blu3r4y opened this issue Jul 11, 2019 · 4 comments
Closed

Faulty underscore escaping in URLs #4

blu3r4y opened this issue Jul 11, 2019 · 4 comments

Comments

@blu3r4y
Copy link

blu3r4y commented Jul 11, 2019

BibTeX Tidy attempts to escape some characters (here: the underscore_ by \_) in URLs, which does then break the URL. I encountered this problems with Biber. Biber allows _ and fails with \_, though, BibTeX and BibLaTex may behave exactly in the opposite way.

As suggested here, underscores should rather be represented by their HTML encoding %5F which works fine for me in Biber (though, maybe someone should also test this with BibTeX and BibLaTex).

In general, using percent-encodings in URLs should always be supported (see here). I guess this would be a good strategy for all special characters in URL fields, not only underscores.

Example:

@book{mybook,
	title        = {My Book},
	author       = {John Doe},
	url          = {https://en.wikipedia.org/wiki/Underscore_(disambiguation)}
}

Tidied-up example:

@book{mybook,
	title        = {My Book},
	author       = {John Doe},
	url          = {https://en.wikipedia.org/wiki/Underscore\_(disambiguation)}
}

Suggested correction:

@book{mybook,
	title        = {My Book},
	author       = {John Doe},
	url          = {https://en.wikipedia.org/wiki/Underscore%5F(disambiguation)}
}
@blu3r4y blu3r4y changed the title Do not escape underscores in URLs Faulty underscore escaping in URLs Jul 11, 2019
@prasannjeet
Copy link

I would suggest to make escaping optional, as some editors such as TexStudio do not support escaped texts if used in a separate ".bib" file.

@FlamingTempura
Copy link
Owner

FlamingTempura commented Jul 18, 2019

Added escaping URLs as an option

Try it out and let me know if this solves your problem: https://flamingtempura.github.io/bibtex-tidy/

@blu3r4y
Copy link
Author

blu3r4y commented Jul 18, 2019

Looks good to me, thank you! :)

@prasannjeet
Copy link

Perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants