GWicke has submitted this change and it was merged.

Change subject: (Bug 49375) Fixed bad regexp in inline_breaks function
......................................................................


(Bug 49375) Fixed bad regexp in inline_breaks function

* One more instance of the ([...]+|..)* pattern that has bit
  us several times as explained in 9f02169f
* This fixes the bad timing behavior on the example from the
  bug report.
* Unrelated: Replaced space+ uses to spaces.
* No change in parser test results.

Change-Id: I9e9e0e25c7f28a89ca1742d6eb59557e1ad1f445
---
M js/lib/mediawiki.tokenizer.peg.js
M js/lib/pegTokenizer.pegjs.txt
2 files changed, 5 insertions(+), 5 deletions(-)

Approvals:
  GWicke: Verified; Looks good to me, approved



diff --git a/js/lib/mediawiki.tokenizer.peg.js 
b/js/lib/mediawiki.tokenizer.peg.js
index a0e1bfd..6757544 100644
--- a/js/lib/mediawiki.tokenizer.peg.js
+++ b/js/lib/mediawiki.tokenizer.peg.js
@@ -266,7 +266,7 @@
                                        ( pos === input.length - 1 ||
                                          input.substr( pos + 1 )
                                                // possibly more equals 
followed by spaces or comments
-                                               .match(/^=*(?:[ 
\t]+|<\!--(?:(?!-->)[^\r\n])+-->)*(?:[\r\n]|$)/) !== null )
+                                               .match(/^=*(?:[ 
\t]|<\!--(?:(?!-->)[^\r\n])+-->)*(?:[\r\n]|$)/) !== null )
                                ) || null;
                case '|':
                        return stops.onStack('pipe') ||
diff --git a/js/lib/pegTokenizer.pegjs.txt b/js/lib/pegTokenizer.pegjs.txt
index 41a6639..a22c629 100644
--- a/js/lib/pegTokenizer.pegjs.txt
+++ b/js/lib/pegTokenizer.pegjs.txt
@@ -702,17 +702,17 @@
      c:inlineline
      e:'='+
      endTPos:({ return pos; })
-     spc:(sp:space+ { return sp.join(''); } / comment)*
+     spc:(spaces / comment)*
      &eolf
      {
         stops.dec('h');
         var level = Math.min( s.length, e.length );
         level = Math.min( 6, level );
         // convert surplus equals into text
-        if(s.length > level) {
+        if (s.length > level) {
             s = s.join('');
             var extras1 = s.substr(0, s.length - level);
-            if(c[0].constructor === String) {
+            if (c[0].constructor === String) {
                 c[0] = extras1 + c[0];
             } else {
                 c.unshift( extras1 );
@@ -1315,7 +1315,7 @@
 // FIXME: fix tag end position
 pre_indent_in_tags
   = & { return stops.inc('pre'); }
-       space+ // XXX: capture space for round-tripping
+       spaces // XXX: capture space for round-tripping
     "<" pre_tag_name
     attribs:generic_attribute*
     ">"

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9e9e0e25c7f28a89ca1742d6eb59557e1ad1f445
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>

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

Reply via email to