Spaces should not be escaped in internal links since the labels also contain the raw spaces. It is also not wise to escape the with `%20` since this is `%` is the comment character in LaTeX.
The caption was added to listing blocks in ftw.contentpage 1.9.0 in pull request 4teamwork/ftw.contentpage#196 for accessibility reasons, hidden by CSS. We now remove the caption tag for PDF generation.
The problem was that the block is not folderish and therefore was not added in the URL automatically. The fix is to use the base-url from the <base> tag.
Related to 4teamwork/ftw.pdfgenerator#35 This tests that the PDF can be built with internal as well as external hyperlinks contianing underscores.
Plone <= 4.2 does not support removing things in tinymce.xml.