Patchwork [1,of,5] hgweb: fix regexp for other styles like monoblue

login
register
mail settings
Submitter Takumi IINO
Date Jan. 7, 2014, 3:52 p.m.
Message ID <2125063139b05aac4aa7.1389109934@iinotakken-no-MacBook-Air.local>
Download mbox | patch
Permalink /patch/3266/
State Accepted
Headers show

Comments

Takumi IINO - Jan. 7, 2014, 3:52 p.m.
# HG changeset patch
# User Takumi IINO <trot.thunder@gmail.com>
# Date 1389108415 -32400
#      Wed Jan 08 00:26:55 2014 +0900
# Node ID 2125063139b05aac4aa7cff2bfd6b334aee8cfc4
# Parent  01bdccfeb9d98ae85388d06c9c694b946f346edf
hgweb: fix regexp for other styles like monoblue

Some styles have indentation.

Patch

diff --git a/mercurial/templates/static/mercurial.js b/mercurial/templates/static/mercurial.js
--- a/mercurial/templates/static/mercurial.js
+++ b/mercurial/templates/static/mercurial.js
@@ -392,11 +392,11 @@  function ajaxScrollInit(urlFormat,
                     };
                     appendFormatHTML(container, messageFormat, message);
                 },
                 function onsuccess(htmlText) {
                     if (mode == 'graph') {
-                        var addHeight = htmlText.match(/^<canvas id="graph".*height="(\d+)"><\/canvas>$/m)[1];
+                        var addHeight = htmlText.match(/^\s*<canvas id="graph".*height="(\d+)"><\/canvas>$/m)[1];
                         addHeight = parseInt(addHeight);
                         graph.canvas.height = addHeight;
 
                         var dataStr = htmlText.match(/^\s*var data = (.*);$/m)[1];
                         var data = JSON.parse(dataStr);