typogrify icon indicating copy to clipboard operation
typogrify copied to clipboard

`widont` filter causes weird spacing (Chrome-specific)

Open joshkehn opened this issue 9 years ago • 6 comments

The widnot filter adds a   to heading (h1, h2, etc) tags and this causes display issues on Chrome. The solution I would propose is to turn off adding this   either as an option or the default. I'm also open to ideas for fixing this issue if it might be style related but I haven't had much luck with that.

Safari

Here's an example of the widnot filter rendering properly in Safari (Version 8.0.4 (10600.4.10.7)).

screen shot 2015-05-15 at 3 29 35 pm

screen shot 2015-05-15 at 3 31 44 pm

Chrome

Here's that same page rendering in Chrome (Version 42.0.2311.152 (64-bit)).

screen shot 2015-05-15 at 3 32 22 pm screen shot 2015-05-15 at 3 32 46 pm

joshkehn avatar May 15 '15 19:05 joshkehn

Hm, this is new to me. Seems like potentially a browser bug, but I'd have to dig deeper. I created a quick test case and I'm not seeing this behavior. I'm wondering if this is potentially linked to the font you are using?

chrisdrackett avatar May 15 '15 20:05 chrisdrackett

Are you sure it's the same html in both cases? It's hard to imagine there's both a Safari bug that lies to you by replacing the escape code with a regular space and a Chrome bug that makes non-breaking spaces twice as wide as regular spaces.

ryneeverett avatar May 15 '15 20:05 ryneeverett

@chrisdrackett Might be a typeface issue actually. Here's a screenshot (it's Hoefler Text) from Safari (left) and Chrome (right)

screen shot 2015-05-15 at 4 45 22 pm

HTML for that page:

<!DOCTYPE html>
<html>
<head>
    <title>Example Page</title>
    <style type="text/css">
        * { font-family: "Hoefler Text", "Adobe Garamond Pro", "Garamond", "Palatino", "Georgia", serif; }
    </style>
</head>
<body>
<h1>This Example&nbsp;Heading</h1>
<p>Examine the heading above.
</body>
</html>

joshkehn avatar May 15 '15 20:05 joshkehn

May be related to Chromium issue #454108

joshkehn avatar May 15 '15 20:05 joshkehn

Either way, an option to turn this off for headings would be nice. Would a PR for that be accepted?

joshkehn avatar May 15 '15 20:05 joshkehn

PR's are always acceptable :)

chrisdrackett avatar May 15 '15 21:05 chrisdrackett