From: Martin G. <mar...@gm...> - 2009-09-01 03:38:23
|
Hi, I recently ran into a bit of an issue when using inline literals with spaces in combination with the custom CSS I am using for my HTML output. I tried modifying my custom CSS to show inline literal text with a dotted box around it and noticed an unexpected behavior: http://cjoint.com/data/jbevwqXxnJ_before.png You can see that each word in the text "CLF Mass Treatment status code" is encased in its own box. I checked out the generated HTML for this and noticed that each word for this section was enclosed in its own <span> tag pair. I then made a patch in the HTML Writer to remove the separate <span> tags for each word and adjusted the 'span.pre' property in the CSS to keep the word-wrap behavior of these literals. This is the end result: http://cjoint.com/data/jbeEa4lUkb_after.png I don't know if this addresses bug 1938891 (http://sourceforge.net/tracker/?func=detail&atid=422030&aid=1938891&group_id=38414) or not, but it certainly appears related to me. There may be a good reason to use <span> tags for every word but I'm not sure what it is. The comments in the HTML Writer do say: # Protect text like "--an-option" from bad line wrapping But I didn't see word wrapping for this kind of text as a problem on Firefox, even with my changes to the Writer. Anyway, on the off chance that my small change actually fixes or improves something in Docutils, I'm attaching it to this mail. Thanks, -Martin |