[PATCH 1 of 5] hgweb: fix regexp for other styles like monoblue
Takumi IINO
trot.thunder at gmail.com
Tue Jan 7 09:52:14 CST 2014
# HG changeset patch
# User Takumi IINO <trot.thunder at 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.
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);
More information about the Mercurial-devel
mailing list