From 2a774f0720f7598b78e5ab9b4c03c470938edc94 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Wed, 31 Oct 2012 16:43:28 -0700 Subject: [PATCH] Set proper TSR on cite expansion output end meta MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also remove the src, as we re-set it based on DSR anyway. No change in parserTests, but three less diffs in L'Opéra national de Paris. Change-Id: Ia6784efe7d76c41f24a183465393bda78641a8eb --- js/lib/ext.Cite.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/lib/ext.Cite.js b/js/lib/ext.Cite.js index fe05fb6b8..9d5b9c192 100644 --- a/js/lib/ext.Cite.js +++ b/js/lib/ext.Cite.js @@ -76,8 +76,7 @@ Cite.prototype.handleRef = function ( tokens ) { var start = startTsr[0], end = endTsr ? endTsr[1] : text.length; span.dataAttribs = { - tsr: [start, end], - src: endTsr ? text.substring(start, end) : text.substring(start) + tsr: [start, end] }; } @@ -93,8 +92,9 @@ Cite.prototype.handleRef = function ( tokens ) { new SelfclosingTagTk( 'meta', [ new KV( 'typeof', 'mw:Object/Ext/Cite/End' ), - new KV( 'about', refId) - ] ) + new KV( 'about', refId), + ] + , { tsr: ( endTsr || [null, text.length] ) } ) ]; //console.warn( 'ref res: ' + JSON.stringify( res, null, 2 ) ); return { tokens: res };