Bug 4136 - "coal" hgweb style adds extra blank line in file view
Summary: "coal" hgweb style adds extra blank line in file view
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: hgweb (show other bugs)
Version: 2.8.1
Hardware: PC Windows
: urgent bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-20 17:44 UTC by Christian Ullrich
Modified: 2014-07-19 14:17 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Ullrich 2013-12-20 17:44 UTC
In the "coal" hgweb style, there is an extra blank line after every source line in file view.

In coal style, the fileline fragment is essentially this:

  fileline = '
    <div>{line|escape}</div>'

A newline, followed by the full source line.

In paper, on the other hand, it is:

  fileline = '
    <span>{strip(line|escape, '\r\n')}</span>'

The problem is the use of <div> in coal style, because the div pushes the following newline (the one preceding the next div) down, resulting in a blank line. What I do not understand is why the newline coming from the unstripped source line does not cause another blank line.

(What I also do not understand is how a bug that was first released with Mercurial 1.3 has not been reported before; this was introduced in 835b1ee111f4.)
Comment 1 Matt Mackall 2013-12-20 18:35 UTC
Broke between 2.6 and 2.7. Bisection blames:

changeset:   19413:f2e4fdb3dd27
user:        Alexander Plavin <me@aplavin.ru>
date:        Thu Jul 04 14:18:44 2013 +0400
summary:     hgweb: code selection without line numbers in file source view
Comment 2 Matt Mackall 2013-12-20 18:37 UTC
This is probably an artifact of the template sharing between coal and paper.
Comment 3 HG Bot 2014-02-27 16:00 UTC
Fixed by http://selenic.com/repo/hg/rev/de48422df393
anuraggoel <anurag.dsps@gmail.com>
coal: hgweb style adds extra blank line in file view (issue4136)

Now hgweb style='coal' adds no extra blank in file view.

(please test the fix)
Comment 4 Christian Ullrich 2014-03-21 09:41 UTC
Confirmed; with this change, the blank lines disappear.