Actions
Defect #11359
closedWiki diff doesn't keep spaces
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
Description
Wiki diff page generates the following HTML:
<div class="text-diff"> ... <br /> sleep 10 <br /> end ... </div>
And here is div.text-diff
style:
.text-diff { padding: 1em; background-color:#f6f6f6; color:#505050; border: 1px solid #e4e4e4; }
From: source:tags/2.0.3/public/stylesheets/application.css#L777
Spaces in Wiki page are ignored because the HTML doesn't use <pre>
tag and the CSS also doesn't use white-space: pre
.
Files
Updated by Kouhei Sutou over 12 years ago
- File 0001-Don-t-ignore-spaces-in-diff-11359.patch 0001-Don-t-ignore-spaces-in-diff-11359.patch added
Here is a patch that removes simple_format_without_paragraph
and surrounds @diff.to_html
with <pre class="text-diff">
instead of <div class="text-diff">
.
Updated by Go MAEDA over 7 years ago
- File 11359-before@2x.png 11359-before@2x.png added
- File 11359-after@2x.png 11359-after@2x.png added
- Target version set to 4.1.0
Before:
After:
Updated by Go MAEDA over 6 years ago
- File without-pre-wrap@2x.png without-pre-wrap@2x.png added
- File with-pre-wrap@2x.png with-pre-wrap@2x.png added
I think it would be better to add white-space: pre-wrap;
to text-diff
class.
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index c680fac92..e5224dca5 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -1073,6 +1073,7 @@ button.tab-left.disabled, button.tab-right.disabled {
background-color:#f6f6f6;
color:#505050;
border: 1px solid #e4e4e4;
+ white-space: pre-wrap;
}
/***** Wiki *****/
Please see the following screenshots. Without white-space: pre-wrap;
, you cannot see the whole content of long lines.
Without pre-wrap
:
With pre-wrap
:
Updated by Jean-Philippe Lang about 6 years ago
- Status changed from New to Closed
- Assignee set to Jean-Philippe Lang
- Resolution set to Fixed
Committed, thanks.
Actions