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

LaTeX writer: URLs are not escaped #2377

Closed
adunning opened this issue Aug 31, 2015 · 6 comments
Closed

LaTeX writer: URLs are not escaped #2377

adunning opened this issue Aug 31, 2015 · 6 comments
Labels

Comments

@adunning
Copy link
Contributor

Under pandoc 1.15.0.6, some unusual but valid characters in URLs are not escaped by the LaTeX writer. For instance, this produces a broken link:

pandoc -o test.pdf -sS << EOT
> <http://www.digizeitschriften.de/dms/resolveppn/?PID=PPN345858530_0013|log48>
> EOT

It appears in the PDF as http://www.digizeitschriften.de/dms/resolveppn/?PID=PPN345858530_0013\T1\textbar{}log48.

Thread: https://groups.google.com/forum/#!msg/pandoc-discuss/E489etyaKgI/cUFuyicXCAAJ (as far as I can tell, no issue was generated from this).

@adunning
Copy link
Contributor Author

If I'm understanding the code correctly, am I correct in thinking that the fix for this is as simple as adding not isUrl to https://github.com/jgm/pandoc/blob/master/src/Text/Pandoc/Writers/LaTeX.hs#L239?

@jgm
Copy link
Owner

jgm commented Sep 25, 2015

@adunning I think you are probably right. It would be good, though, to figure out where else this might be needed -- i.e. which characters that are normally escaped should not be escaped in URL contexts.

@adunning
Copy link
Contributor Author

It looks as if it's the list of 'unwise' characters that are not handled within a URL. The question, then, might be whether it would be best to escape these characters in all outputs (which has come up before in #1640).

@adunning
Copy link
Contributor Author

Taking the example from #1640, this also results in an incorrect PDF:

pandoc -F pandoc-citeproc -o test.pdf << EOT
---
references:
- id: test
  DOI: 10.1002/(sici)1097-0185(19990415)257:2<50::aid-ar4>3.3.co;2-n
...

@test

EOT

@jgm jgm added the bug label Oct 7, 2015
jgm added a commit that referenced this issue Oct 12, 2015
HTML, LaTeX writers adjusted.
The special characters are '<','>','|','"','{','}','[',']','^', '`'.

Closes #1640, #2377.
@jgm
Copy link
Owner

jgm commented Oct 12, 2015

Closed by 1e8a25a

@jgm jgm closed this as completed Oct 12, 2015
@adunning
Copy link
Contributor Author

Thanks for taking care of this!

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

No branches or pull requests

2 participants