# HG changeset patch # User Gregory Szorc # Date 2017-07-17 22:54:15 # Node ID 875b054e5b9530d8a245bf2f4e24eaa8e3dadac3 # Parent 22371eabb3b19a1659b5c1c018112d0b24872018 gitweb: preserve whitespace in description Without this, multiple spaces or tabs in the commit message aren't preserved and things like tables don't align properly. As part of adding the CSS rule, we had to cuddle the content with the
to not introduce leading and trailing whitespace. The "addbreaks" filter was also removed because it would insert an additional newline, effectively double spacing content. Differential Revision: https://phab.mercurial-scm.org/D113 diff --git a/mercurial/templates/gitweb/changelogentry.tmpl b/mercurial/templates/gitweb/changelogentry.tmpl --- a/mercurial/templates/gitweb/changelogentry.tmpl +++ b/mercurial/templates/gitweb/changelogentry.tmpl @@ -7,8 +7,6 @@
{author|obfuscate} [{date|rfc822date}] rev {rev}
-
-{desc|strip|escape|websub|addbreaks|nonempty} -
-
+
{desc|strip|escape|websub|nonempty} +
diff --git a/mercurial/templates/gitweb/changeset.tmpl b/mercurial/templates/gitweb/changeset.tmpl --- a/mercurial/templates/gitweb/changeset.tmpl +++ b/mercurial/templates/gitweb/changeset.tmpl @@ -45,9 +45,7 @@ changeset | {child%changesetchild}
-
-{desc|strip|escape|websub|addbreaks|nonempty} -
+
{desc|strip|escape|websub|nonempty}
diff --git a/mercurial/templates/gitweb/fileannotate.tmpl b/mercurial/templates/gitweb/fileannotate.tmpl --- a/mercurial/templates/gitweb/fileannotate.tmpl +++ b/mercurial/templates/gitweb/fileannotate.tmpl @@ -61,9 +61,7 @@ annotate |
-
-{desc|strip|escape|websub|addbreaks|nonempty} -
+
{desc|strip|escape|websub|nonempty}
-
-{desc|strip|escape|websub|addbreaks|nonempty} -
+
{desc|strip|escape|websub|nonempty}
 span:target {
 
 .description {
     font-family: monospace;
+    white-space: pre;
 }
 
 /* Followlines */
diff --git a/tests/test-hgweb.t b/tests/test-hgweb.t
--- a/tests/test-hgweb.t
+++ b/tests/test-hgweb.t
@@ -340,7 +340,7 @@ static file
 
   $ get-with-headers.py --twice localhost:$HGPORT 'static/style-gitweb.css' - date etag server
   200 Script output follows
-  content-length: 8985
+  content-length: 9007
   content-type: text/css
   
   body { font-family: sans-serif; font-size: 12px; border:solid #d9d8d1; border-width:1px; margin:10px; background: white; color: black; }
@@ -520,6 +520,7 @@ static file
   
   .description {
       font-family: monospace;
+      white-space: pre;
   }
   
   /* Followlines */