Commit 02c618aa authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 388723: Make the browser wrap comments on display in addition to the normal…

Bug 388723: Make the browser wrap comments on display in addition to the normal wrapping, to support CJK languages that have no spaces. Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=himorin, r=glob
parent fad558c7
...@@ -13,6 +13,11 @@ ...@@ -13,6 +13,11 @@
* Contributor(s): Marc Schumann <wurblzap@gmail.com> * Contributor(s): Marc Schumann <wurblzap@gmail.com>
*/ */
.bz_comment_text, .uneditable_textarea {
white-space: pre;
word-wrap: break-word;
}
#footer #useful-links li { #footer #useful-links li {
padding-bottom: 0.8ex; padding-bottom: 0.8ex;
} }
......
...@@ -243,6 +243,22 @@ div#docslinks { ...@@ -243,6 +243,22 @@ div#docslinks {
margin-bottom: 2em; margin-bottom: 2em;
} }
/* The rules for these classes make international text wrap correctly,
even for languages like Japanese that have no spaces. */
.bz_comment_text, .uneditable_textarea {
font-family: monospace;
/* Note that these must all be on separate lines or they stop
working in Konqueror. */
white-space: pre-wrap; /* CSS 3 & 2.1 */
white-space: -moz-pre-wrap; /* Gecko */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
}
.bz_comment_text {
width: 50em;
}
.bz_first_comment { .bz_first_comment {
} }
...@@ -257,6 +273,8 @@ div#docslinks { ...@@ -257,6 +273,8 @@ div#docslinks {
span.quote { span.quote {
color: #65379c; color: #65379c;
/* Make quoted text not wrap. */
white-space: pre;
} }
table#flags th, table#flags th,
...@@ -318,8 +336,7 @@ dl dl > dt { ...@@ -318,8 +336,7 @@ dl dl > dt {
/* For bug fields */ /* For bug fields */
.uneditable_textarea { .uneditable_textarea {
white-space: pre; width: 30em;
font-family: monospace;
} }
div.user_match { div.user_match {
......
...@@ -50,7 +50,9 @@ ...@@ -50,7 +50,9 @@
[% IF cgi.param("comment") %] [% IF cgi.param("comment") %]
<p> <p>
Your comment was:<br> Your comment was:<br>
<blockquote><pre>[% cgi.param("comment") FILTER wrap_comment FILTER html %]</pre></blockquote> <blockquote><pre class="bz_comment_text">
[% cgi.param("comment") FILTER wrap_comment FILTER html %]
</pre></blockquote>
</p> </p>
[% END %] [% END %]
......
...@@ -216,7 +216,8 @@ ...@@ -216,7 +216,8 @@
[% ELSE %] [% ELSE %]
[% wrapped_comment = comment.body FILTER wrap_comment %] [% wrapped_comment = comment.body FILTER wrap_comment %]
[% END %] [% END %]
<pre[% ' id="comment_text_' _ count _ '"' IF mode == "edit" %]> <pre class="bz_comment_text"
[% ' id="comment_text_' _ count _ '"' IF mode == "edit" %]>
[%- wrapped_comment FILTER quoteUrls(bug.bug_id) -%] [%- wrapped_comment FILTER quoteUrls(bug.bug_id) -%]
</pre> </pre>
</div> </div>
......
...@@ -66,7 +66,9 @@ ...@@ -66,7 +66,9 @@
[% IF cgi.param("comment") %] [% IF cgi.param("comment") %]
<p> <p>
Your comment was:<br> Your comment was:<br>
<blockquote><pre>[% cgi.param("comment") FILTER wrap_comment FILTER html %]</pre></blockquote> <blockquote><pre class="bz_comment_text">
[% cgi.param("comment") FILTER wrap_comment FILTER html %]
</pre></blockquote>
</p> </p>
[% END %] [% END %]
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<hr> <hr>
<p> <p>
<pre> <pre class="bz_comment_text">
[%- cgi.param("text") FILTER wrap_comment FILTER quoteUrls FILTER html -%] [%- cgi.param("text") FILTER wrap_comment FILTER quoteUrls FILTER html -%]
</pre> </pre>
</p> </p>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<hr> <hr>
<p> <p>
<pre> <pre class="bz_comment_text">
[%- cgi.param("text") FILTER wrap_comment FILTER quoteUrls -%] [%- cgi.param("text") FILTER wrap_comment FILTER quoteUrls -%]
</pre> </pre>
</p> </p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment