Cscott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/80167
Change subject: Add autoInsertedStart/autoInsertedEnd flags in QuoteTransformer.
......................................................................
Add autoInsertedStart/autoInsertedEnd flags in QuoteTransformer.
Change-Id: I94d5823274d71ec350cf93c990c13020b17d50f9
---
M js/lib/ext.core.QuoteTransformer.js
1 file changed, 6 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid
refs/changes/67/80167/1
diff --git a/js/lib/ext.core.QuoteTransformer.js
b/js/lib/ext.core.QuoteTransformer.js
index 613bc04..8e73bff 100644
--- a/js/lib/ext.core.QuoteTransformer.js
+++ b/js/lib/ext.core.QuoteTransformer.js
@@ -300,14 +300,17 @@
var startpos = tsr ? tsr[0] : null, endpos = tsr ? tsr[1] : null;
for (var i=0; i<tags.length; i++) {
if (tsr) {
- if ( ( i===0 || i===2) && ignoreBogusTwo ) {
- tags[i].dataAttribs.tsr = [ startpos, startpos
];
+ if ( i===0 && ignoreBogusTwo ) {
+ tags[i].dataAttribs.autoInsertedEnd = 1;
+ } else if ( i === 2 && ignoreBogusTwo ) {
+ tags[i].dataAttribs.autoInsertedStart = 1;
} else if (tags[i].name === 'b') {
tags[i].dataAttribs.tsr = [ startpos, startpos
+ 3 ];
+ startpos = tags[i].dataAttribs.tsr[1];
} else if (tags[i].name === 'i') {
tags[i].dataAttribs.tsr = [ startpos, startpos
+ 2 ];
+ startpos = tags[i].dataAttribs.tsr[1];
} else { console.assert(false); }
- startpos = tags[i].dataAttribs.tsr[1];
}
result.push(tags[i]);
}
--
To view, visit https://gerrit.wikimedia.org/r/80167
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I94d5823274d71ec350cf93c990c13020b17d50f9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits