When a node title includes a special character such as an apostrophe, the printer-friendly and PDF that is auto-generated from the node renders the apostrophe using HTML encoding (')
The node body is rendered correctly, this just affects the title.
I'm not sure this is the best solution, but calling html_entity_decode on the check_plained version of the title works.
--- a/print.pages.inc
+++ b/../print_new/print.pages.inc
@@ -168,7 +168,7 @@ function print_preprocess_print(&$variables) {
$variables['url'] = url($path, array('absolute' => TRUE, 'query' => $variables['query']));
$variables['source_url'] = url(variable_get('print_sourceurl_forcenode', PRINT_SOURCEURL_FORCENODE_DEFAULT) ? drupal_get_normal_path($path) : $path, array('alias' => TRUE, 'absolute' => TRUE, 'query' => $variables['query']));
$variables['cid'] = isset($node->cid) ? $node->cid : NULL;
- $variables['print_title'] = check_plain($node->title);
+ $variables['print_title'] = html_entity_decode(check_plain($node->title));
$variables['head'] = drupal_get_html_head();
$variables['robots_meta'] = _print_robots_meta_generator();
Comment | File | Size | Author |
---|---|---|---|
#4 | print-html-decode.patch | 616 bytes | kyoder |
#3 | print_title_includes-2728885-3.patch | 1.87 KB | Nitesh Sethia |
Comments
Comment #2
bart atlas CreditAttribution: bart atlas as a volunteer commentedComment #3
Nitesh Sethia CreditAttribution: Nitesh Sethia as a volunteer and at QED42 commentedCreating a patch for the same.
Comment #4
kyoder CreditAttribution: kyoder commentedHere's an updated version of the patch.
Comment #6
renatogMoved to the dev branch. Thanks a lot