I have documents in markdown that are converted to PDF using pandoc
, which relies on a latex engine to generate the output file.
The documents contain long web addresses as well as directory and file locations in disk. These are often written as normal text, and other times within backticks. Note these do not use \url{}
or similar since that would require changing the documents.
I'd like these addresses to automatically wrap. If this was done at forward slash (/
), for example, I think it would be sufficient. Currently, this is the behavior:
- Address in backticks never wraps;
- Address outside backticks wraps at hyphen; and
- Address outside backticks never wraps at forward slash.
Example Input
# Title
## Subtitle
This is a long address: /users/foo/home/somelonglocation/somelonglocation/break-it-break-it-break-it-break-it-break-it/index.html
http://www.thissitedoesnotexit.corn/abcabcabcabcabcabcabcabcabc/defdefdefdefdef/ghighighi/jkljkljkjkljkljkljkljkljkljkljkljkljkljkljkl/mno-pqr-stu/index.html
In code backticks: `http://www.thissitedoesnotexit.corn/abcabcabcabcabcabcabcabcabc/defdefdefdefdef/ghighighi/jkljkljkjkljkljkljkljkljkljkljkljkljkljkljkl/mno-pqr-stu/index.html`
The end.
Compilation command: $ pandoc-local -o output.pdf input.md