Subramanya Sastry has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/78618


Change subject: Removed code that went dead after changes in commit 171e1596
......................................................................

Removed code that went dead after changes in commit 171e1596

* PreHandler FSM changed in the above commit which killed some of
  the checks and code there.  I should have recognized that and
  cleaned up back then .. but better late than never.

Change-Id: I1fbd820db1a6b1e079d255bd13b4970865128dcf
---
M js/lib/ext.core.PreHandler.js
1 file changed, 5 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid 
refs/changes/18/78618/1

diff --git a/js/lib/ext.core.PreHandler.js b/js/lib/ext.core.PreHandler.js
index e158488..72e2296 100644
--- a/js/lib/ext.core.PreHandler.js
+++ b/js/lib/ext.core.PreHandler.js
@@ -32,10 +32,9 @@
  | SOL           | --- sol-tr  --> | SOL           | TOKS << tok              |
  | SOL           | --- other   --> | IGNORE        | purge                    |
  + --------------+-----------------+---------------+--------------------------+
- | PRE           | --- nl      --> | SOL           | purge   if |TOKS| == 0   |
- |               |                 |               | gen-pre if |TOKS| > 0 (#)|
- | PRE           |  html-blk tag   | IGNORE        | purge   if |TOKS| == 0   |
- |               |  wt-table tag   |               | gen-pre if |TOKS| > 0 (#)|
+ | PRE           | --- nl      --> | SOL           | purge                    |
+ | PRE           |  html-blk tag   | IGNORE        | purge                    |
+ |               |  wt-table tag   |               |                          |
  | PRE           | --- eof     --> | SOL           | purge                    |
  | PRE           | --- sol-tr  --> | PRE           | SOL-TR-TOKS << tok       |
  | PRE           | --- other   --> | PRE_COLLECT   | TOKS = SOL-TR-TOKS + tok |
@@ -55,13 +54,6 @@
  | IGNORE        | --- nl      --> | SOL           | purge                    |
  | IGNORE        | --- eof     --> | SOL           | purge                    |
  + --------------+-----------------+---------------+--------------------------+
-
- # In PRE-state, |TOKS| > 0 only if we got here from MULTILINE_PRE.  In 
addition,
-   we are guaranteed that they will not all be whitespace/sol-transparent 
tokens
-   since the transition path would have been:
-      SOL -> PRE -> PRE_COLLECT -> MULTILINE_PRE -> PRE
-   and the transition from PRE -> PRE_COLLECT adds a non-ws/non-sol-tr token
-   to TOKS.
 
  ## In these states, check if the whitespace token is a single space or has
    additional chars (white-space or non-whitespace) -- if yes, slice it off
@@ -227,13 +219,7 @@
                        break;
 
                case PreHandler.STATE_PRE:
-                       if (this.tokens.length > 0) {
-                               // we got here from a multiline-pre
-                               ret = this.processPre(token);
-                       } else {
-                               // we will never get here from a multiline-pre
-                               ret = this.getResultAndReset(token);
-                       }
+                       ret = this.getResultAndReset(token);
                        this.preTSR = initPreTSR(token);
                        this.state = PreHandler.STATE_SOL;
                        break;
@@ -350,13 +336,7 @@
                                } else if (Util.isTableTag(token) ||
                                        (token.isHTMLTag() && 
Util.isBlockTag(token.name)))
                                {
-                                       if (this.tokens.length > 0) {
-                                               // we got here from a 
multiline-pre
-                                               ret = this.processPre(token);
-                                       } else {
-                                               // we can never get here from a 
multiline-pre
-                                               ret = 
this.getResultAndReset(token);
-                                       }
+                                       ret = this.getResultAndReset(token);
                                        this.moveToIgnoreState();
                                } else {
                                        this.tokens = 
this.tokens.concat(this.solTransparentTokens);

-- 
To view, visit https://gerrit.wikimedia.org/r/78618
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1fbd820db1a6b1e079d255bd13b4970865128dcf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to