From 3eff5dfc13eb3c5a35866263a2785575ca094f84 Mon Sep 17 00:00:00 2001 From: Subramanya Sastry Date: Tue, 20 Nov 2012 19:42:30 -0600 Subject: [PATCH] Unrelated fixes/cleanup addressing recent git-review comments. * Replaced empty (mw:Placeholder) span tags with meta-tag. * Minor code refactoring in DSR computation. * Removed hardcoding of "mwt" prefix for object ids. * Added rt-info for html tags that are not lower-case in the source wikitext. - Additional 2 wt2wt tests green. Change-Id: I9bb6a075bc60b6d78186d23000128eef6a04c787 --- js/lib/ext.Cite.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/js/lib/ext.Cite.js b/js/lib/ext.Cite.js index 9ab10feb1..c588cc1c8 100644 --- a/js/lib/ext.Cite.js +++ b/js/lib/ext.Cite.js @@ -75,12 +75,12 @@ Cite.prototype.handleRef = function ( tokens ) { //bits.push(Util.formatNum( ref.groupIndex + 1 )); bits.push(ref.groupIndex + 1); - var refId = "#mwt" + this.manager.env.generateUID(), + var about = "#" + this.manager.env.newObjectId(), text = this.manager.env.text, span = new TagTk('span', [ new KV('id', linkback), new KV('class', 'reference'), - new KV('about', refId), + new KV('about', about), new KV('typeof', 'mw:Object/Ext/Cite') ]); @@ -108,7 +108,7 @@ Cite.prototype.handleRef = function ( tokens ) { new EndTagTk( 'span' ), new SelfclosingTagTk( 'meta', [ new KV( 'typeof', 'mw:Object/Ext/Cite/End' ), - new KV( 'about', refId) + new KV( 'about', about) ], { tsr: endTsr } ) ]; //console.warn( 'ref res: ' + JSON.stringify( res, null, 2 ) ); @@ -126,8 +126,7 @@ function genPlaceholderTokens(env, token, src) { } return [ - new TagTk('span', [ new KV( 'typeof', 'mw:Placeholder' ) ], dataAttribs), - new EndTagTk('span') + new SelfclosingTagTk('meta', [ new KV( 'typeof', 'mw:Placeholder' ) ], dataAttribs) ]; }