From a84adaeddb91fbda29bd737cae7fb1412f669dd2 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Mon, 18 Feb 2013 12:01:56 -0700 Subject: [PATCH] Revert most of the change to word break, but introduce a nbsp for browser metrics. Related to PR 13305: I tried to use zero-width-space to force appropriate line breaks, but unfortunately under Opera on Linux, this shows as unsupported character glyphs. Since I can't reliably use zero-width-space, I'm backtracking to the prior solution on introducing spans with the mywbr class. However, I've added in a   element to the content of the span, as suggested elsewhere on the web. This appears to fix the _gcpointer issue that Eric sees. original commit: 7323dde0eabf54dafb85d0e882ccefbf33e5535f --- collects/scribble/html-render.rkt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/collects/scribble/html-render.rkt b/collects/scribble/html-render.rkt index c3c7177d..df2afa4f 100644 --- a/collects/scribble/html-render.rkt +++ b/collects/scribble/html-render.rkt @@ -1410,10 +1410,12 @@ (if m (list* (substring i 0 (cdar m)) ;; Most browsers wrap after a hyphen. The one that - ;; doesn't, Firefox, pays attention to wbr. But - ;; almost all browsers pay attention to zero width - ;; space, so we'll insert one here. - #x200b + ;; doesn't, Firefox, pays attention to wbr. Some + ;; browsers ignore wbr, but at least they don't do + ;; strange things with it. + (if (equal? #\- (string-ref i (caar m))) + '(wbr) + '(span ([class "mywbr"]) " " nbsp)) (render-other (substring i (cdar m)) part ri)) (ascii-ize i)))] [(symbol? i)