From 82f98747a4e33596f8c027cb574b8ee3cb4c7d6b Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 11 Aug 2020 10:50:10 -0700 Subject: [PATCH] (stable) Coerce Chrome into breaking monospaced text when printing tables to PDFs Summary: See T13564. In Chrome only, printing tables with a cell containing an unbroken monospaced text element fails to wrap/break the cell. Adding "overflow-wrap" appears to fix this without making anything worse. Try this until new problems arise. Test Plan: Printed such a table to PDF in Chrome, got wrapping with all content visible in the PDF. Differential Revision: https://secure.phabricator.com/D21439 --- resources/celerity/map.php | 6 +++--- webroot/rsrc/css/core/remarkup.css | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index d10f117847..d3deb5381d 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -9,7 +9,7 @@ return array( 'names' => array( 'conpherence.pkg.css' => '0e3cf785', 'conpherence.pkg.js' => '020aebcf', - 'core.pkg.css' => 'da792a0f', + 'core.pkg.css' => '9b2e2e20', 'core.pkg.js' => '845355f4', 'dark-console.pkg.js' => '187792c2', 'differential.pkg.css' => '5c459f92', @@ -114,7 +114,7 @@ return array( 'rsrc/css/application/tokens/tokens.css' => 'ce5a50bd', 'rsrc/css/application/uiexample/example.css' => 'b4795059', 'rsrc/css/core/core.css' => '1b29ed61', - 'rsrc/css/core/remarkup.css' => '7d3ebc86', + 'rsrc/css/core/remarkup.css' => '94c3d777', 'rsrc/css/core/syntax.css' => '548567f6', 'rsrc/css/core/z-index.css' => 'ac3bfcd4', 'rsrc/css/diviner/diviner-shared.css' => '4bd263b0', @@ -798,7 +798,7 @@ return array( 'phabricator-object-selector-css' => 'ee77366f', 'phabricator-phtize' => '2f1db1ed', 'phabricator-prefab' => '5793d835', - 'phabricator-remarkup-css' => '7d3ebc86', + 'phabricator-remarkup-css' => '94c3d777', 'phabricator-search-results-css' => '9ea70ace', 'phabricator-shaped-request' => '995f5102', 'phabricator-slowvote-css' => '1694baed', diff --git a/webroot/rsrc/css/core/remarkup.css b/webroot/rsrc/css/core/remarkup.css index 1688da31f0..5bee3e373d 100644 --- a/webroot/rsrc/css/core/remarkup.css +++ b/webroot/rsrc/css/core/remarkup.css @@ -86,7 +86,11 @@ padding: 1px 4px; border-radius: 3px; white-space: pre-wrap; + + /* See T13564. This is a narrow control for PDF printing behavior in + Chrome. */ line-break: anywhere; + overflow-wrap: anywhere; } /* NOTE: You can currently produce this with [[link | `name`]]. Restore the