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

EPUB reader mangles URLs #2284

Closed
jgm opened this issue Jul 8, 2015 · 6 comments
Closed

EPUB reader mangles URLs #2284

jgm opened this issue Jul 8, 2015 · 6 comments
Labels

Comments

@jgm
Copy link
Owner

jgm commented Jul 8, 2015

To see this, do

pandoc README -o r.epub
pandoc r.epub -t markdown

and look at the links at the beginning.

Culprit seems to be

  . (walk normalisePath)

in fixInternalReferences, but I couldn't figure out what this was for. @mpickering, can you shed any light/fix?

@mpickering
Copy link
Collaborator

What is the precise problem? I generated it to HTML and all of the internal
links seem to work correctly?

If I remember right this step was because some EPUB documents have internal
references which span internal files - by modifying the IDs in this way,
the internal references work when all the files are read together.

On Wed, Jul 8, 2015 at 8:07 PM, John MacFarlane [email protected]
wrote:

To see this, do

pandoc README -o r.epub
pandoc r.epub -t markdown

and look at the links at the beginning.

Culprit seems to be

. (walk normalisePath)

in fixInternalReferences, but I couldn't figure out what this was for.
@mpickering https://github.com/mpickering, can you shed any light/fix?


Reply to this email directly or view it on GitHub
#2284.

@jgm
Copy link
Owner Author

jgm commented Jul 8, 2015

+++ Matthew Pickering [Jul 08 15 15:23 ]:

What is the precise problem? I generated it to HTML and all of the
internal
links seem to work correctly?

I'm talking about the external links, e.g. in the first long
paragraph of the README:

Pandoc is a [Haskell]() library for converting from one markup format to
another, and a command-line tool that uses this library. It can read
[Markdown](), [CommonMark](commonmark.org), and (subsets of)
[Textile](textile), [reStructuredText](introduction.html), [HTML](),
[LaTeX](), [MediaWiki markup](Help:Formatting), [TWiki
markup](TextFormattingRules), [Haddock markup](ch03s08.html),

@mpickering
Copy link
Collaborator

I need to think about how to fix this. The problem is that internal links
need to be mangled to point to the right place when the files get collapsed
together.

On Thu, Jul 9, 2015 at 1:52 AM, John MacFarlane [email protected]
wrote:

+++ Matthew Pickering [Jul 08 15 15:23 ]:

What is the precise problem? I generated it to HTML and all of the
internal
links seem to work correctly?

I'm talking about the external links, e.g. in the first long
paragraph of the README:

Pandoc is a [Haskell]() library for converting from one markup format to
another, and a command-line tool that uses this library. It can read
[Markdown](), [CommonMark](commonmark.org), and (subsets of)
[Textile](textile), [reStructuredText](introduction.html), [HTML](),
[LaTeX](), [MediaWiki markup](Help:Formatting), [TWiki
markup](TextFormattingRules), [Haddock markup](ch03s08.html),


Reply to this email directly or view it on GitHub
#2284 (comment).

@jgm
Copy link
Owner Author

jgm commented Jul 21, 2015

Is it enough to just leave external links alone?

+++ Matthew Pickering [Jul 21 15 16:21 ]:

I need to think about how to fix this. The problem is that internal
links
need to be mangled to point to the right place when the files get
collapsed
together.
On Thu, Jul 9, 2015 at 1:52 AM, John MacFarlane
[email protected]
wrote:

+++ Matthew Pickering [Jul 08 15 15:23 ]:

What is the precise problem? I generated it to HTML and all of the
internal
links seem to work correctly?

I'm talking about the external links, e.g. in the first long
paragraph of the README:

Pandoc is a [Haskell]() library for converting from one markup format
  to
another, and a command-line tool that uses this library. It can read
[Markdown](), [CommonMark](commonmark.org), and (subsets of)
[Textile](textile), [reStructuredText](introduction.html), [HTML](),
[LaTeX](), [MediaWiki markup](Help:Formatting), [TWiki
markup](TextFormattingRules), [Haddock markup](ch03s08.html),


Reply to this email directly or view it on GitHub
#2284 (comment).


Reply to this email directly or [1]view it on GitHub.

References

  1. EPUB reader mangles URLs #2284 (comment)

@jgm
Copy link
Owner Author

jgm commented Aug 8, 2015

@mpickering, have you had a chance to think about this? It would be nice to fix this bug.

@jgm jgm added the bug label Aug 8, 2015
@mpickering
Copy link
Collaborator

Yes leaving external links alone should be sufficient. The transformation
was designed with only internal links in mind.

On Sat, Aug 8, 2015 at 6:17 AM, John MacFarlane [email protected]
wrote:

@mpickering https://github.com/mpickering, have you had a chance to
think about this? It would be nice to fix this bug.


Reply to this email directly or view it on GitHub
#2284 (comment).

@jgm jgm closed this as completed in 7b8c005 Aug 10, 2015
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