Commit graph

2136 commits

Author SHA1 Message Date
Gabriel Wicke 17af335748 Fix a crasher in unbalanced heading tokenization
Example input:

=== foo ==

Old result:
http://www.mediawiki.org/w/index.php?title=VisualEditor:Test&diff=prev&oldid=554403

Change-Id: I0bc135884833607cedb62ec9c045310df3649dd8
2012-06-28 12:34:32 +02:00
Gabriel Wicke 4e541223b0 Merge "Rename data-mw-gc to data-gen. Credit to James!" 2012-06-27 17:15:25 +00:00
Gabriel Wicke 4e86337a43 Merge "Add basic tsr on indent-pre end tag" 2012-06-27 17:11:38 +00:00
Gabriel Wicke 424a246b00 Rename data-mw-gc to data-gen. Credit to James!
Change-Id: Iacbe20b355ddf5f12fffb71ff4dd978ac4364928
2012-06-27 19:08:14 +02:00
Trevor Parscal 1067f84764 Merge "Removing some logging" 2012-06-27 16:42:34 +00:00
Trevor Parscal efe26d9be2 Merge "(bug 36201) Control-K triggers link inspector" 2012-06-27 16:41:51 +00:00
Christian Williams b9f6baba63 (bug 36201) Control-K triggers link inspector
Change-Id: I0ffd237ce51d1899d2151fb76243e818c5f5cfb8
2012-06-27 09:41:06 -07:00
Trevor Parscal 02e24d6a39 Merge "Bugzilla:37804 - Double bound events were causing double backspace bugs" 2012-06-27 16:20:43 +00:00
Trevor Parscal e1905341c1 Merge "Bugzilla:33093 - Shift-Enter splits at paragraphs instead of list items" 2012-06-27 16:20:08 +00:00
Gabriel Wicke df26663a3f Add basic tsr on indent-pre end tag
This is a zero-length tsr for now (and thus not 100% correct), but will do the
job for starttag / endtag range establishment

Change-Id: Iedd50ad319aa8d5916434fb6744deb04e031e456
2012-06-27 18:08:49 +02:00
Gabriel Wicke c02218c736 Merge changes Idfa5d6a8,I700142a5
* changes:
  Represent nowiki as span instead of meta
  Round-trip html entities and introduce data-mw-gc attribute
2012-06-27 16:07:48 +00:00
GWicke d4eb4ce741 Merge "Code cleanup and more newline fixes." 2012-06-27 13:26:22 +00:00
Subramanya Sastry 4d2a46fb44 Code cleanup and more newline fixes.
* Removed dead commented out code.
* Cleaned up newline handling in serializer some more.
* Now, onNewLine and onStartOfLine reflect serializer state
  more accurately.
* No implicit new lines for explicit html tags.
* 9 more roundtrip tests now green.

Change-Id: I9f640de2ae769c7472538fa687400dc8a40c2b2d
2012-06-27 15:23:22 +02:00
Gabriel Wicke a1d05976ce Merge "Small (and incomplete) fix to table cell tsr" 2012-06-27 12:45:39 +00:00
Gabriel Wicke 53451bfc50 Small (and incomplete) fix to table cell tsr
Change-Id: I14347939de32af698d7ce0b649165982908c49aa
2012-06-27 14:45:12 +02:00
Gabriel Wicke 7108ee985a Represent nowiki as span instead of meta
Change-Id: Idfa5d6a8ee7b2d17205779361ca69d075a79964d
2012-06-27 13:59:14 +02:00
Gabriel Wicke 0b9a420129 Round-trip html entities and introduce data-mw-gc attribute
297 round-trip tests are passing with this patch.

TODO:
* generalize data-mw-gc handling in the serializer for any tag
* use data-mw-gc="both" and data-mw.src: 'the wikitext' for round-tripping of
  wikitext structures, optionally with some presentational (but read-only)
  content
* use span and data-mw-gc="both" for nowiki

Change-Id: I700142a56818977c20c8c06e6a5f2e77a708d25e
2012-06-27 12:52:52 +02:00
Subramanya Sastry 1a504a5f54 Added tokenizer support for ----
Change-Id: Idc5519350d11ae91b2ec64553f847d56e22d63bb
2012-06-25 16:40:34 -05:00
Subramanya Sastry d5e6ec34aa Deleted dead PEG productions
Change-Id: I9b859f79f9900b3d320aa1ad0283a4b5ae6c4331
2012-06-25 13:17:01 -05:00
Translation updater bot 7fa2c97fc0 Localisation updates from http://translatewiki.net.
Change-Id: Ibe3268c865a843b5756f00fb396cac62cc37a09d
2012-06-24 20:07:18 +00:00
Translation updater bot 44e36f199a $COMMITMSG
Change-Id: Ieed1cb99b47c0032295ec1a259bb7b5f3d926ac3
2012-06-23 20:16:57 +00:00
Gabriel Wicke 08b5ed1a43 Use _inNewlineContext method instead of bare onNewline
This makes sure that we escape start-of-line syntax when needed, since
onNewline is often not yet set.

Discussion / background:
[19:18] <subbu> this will fix it, but, i think this is asking for another
minor refactoring of these flags ... because this is a subtle fix which means
it might be possible to make it clearer.  onNewline is one true in on
direction, i.e. if true, we are in a new line state, but if we are in a
newline context, onNewline is not true, which is why this new method is
needed.
[19:19] <subbu> i dont know if it is possible, but it seems like it shoudl be
possible.  but, something for later.
[19:20] <subbu> badly phraed.  "onNewline" ==> in new line context, but if in
new line context, onNewline may be false.
[19:20] <gwicke> we should perhaps update it as early as possible instead
[19:21] <subbu> i cannot today, but possible monday.  i am heading out in
about 15-30 mins.
[19:22] <gwicke> will need to check all conditions depending on it in
_serializeToken
[19:22] <subbu> oh, i misunderstood you :)
[19:22] <gwicke> and if there are cases where the onNewline / onStartOfLine
state could be reverted later
[19:23] <subbu> you were referring to the flag, i thought you meant we should
fix this sooner than later.
[19:23] <gwicke> yes, I wasn't terribly clear
[19:23] <gwicke> you wrote something about following productions swallowing
newlines, but I think we don't actually do that any more
[19:24] <gwicke> I'm quite optimistic that updating those flags much earlier
would work
[19:25] <subbu> yes, it could fix it.
[19:26] <subbu> you might be right reg. swallowing.  it was happening earlier.
but, not right now, after single-line mode and other fixes.

Change-Id: Ic1d8141c04eb54a59977d0ba87bcf06bafd421e0
2012-06-23 19:27:56 +02:00
Gabriel Wicke f731125804 Explain reasoning behind number of worker calculation
Change-Id: I92ae0bb6e02caef98b0d68de4424e775d8922651
2012-06-23 17:30:52 +02:00
Gabriel Wicke d4dc8d86d9 Entity-escape [<>] in text content
This should not really be needed if the tokenizer did not decode html entities
on the fly. It is still a quick way to make sure no htmlish content can be
inserted even with the current decoding.

The next step and proper fix is to make entity decoding either optional in the
tokenizer (flag-controlled), or move it to a later stage in the token
processing pipeline.

Change-Id: Ife093dcfb95113763dab5635b098c795d3550586
2012-06-23 17:06:10 +02:00
Subramanya Sastry 5f584909e1 Added documentation + minor code refactoring
* Renamed defaultOptions to initialState
* Got rid of unused state property
* Added comments explaining how state attributes
  and tag handler flags are used
* Refactored listItemHandler check into functions and
  added FIXME possible rewriting of that check.
* Protected serializeDOM in a try-catch handler to
  catch exceptions and output the exception to the console.

Change-Id: I3d351c06e4b86baeb5a55243b11dbfa9baca5bb7
2012-06-22 18:29:46 -05:00
Christian Williams a26708dd6e Removing some logging
Change-Id: I2876e56d2e3680d21877103618e59afec1c81ef9
2012-06-22 15:49:34 -07:00
Christian Williams 89e0f3d6ad Bugzilla:37804 - Double bound events were causing double backspace bugs
Change-Id: I589185d077e1efe6fb2c0457a290a8ac9ce8bceb
2012-06-22 15:39:43 -07:00
Christian Williams 122a31a021 Bugzilla:33093 - Shift-Enter splits at paragraphs instead of list items
Change-Id: Ie32e878cf9c71f7179143c631a01c0e2e671ed18
2012-06-22 15:05:35 -07:00
Translation updater bot 7a3d8fabdb Localisation updates from http://translatewiki.net.
Change-Id: Ia8bb7afcc50438516fe32cf3ae1f2d2235fb22de
2012-06-22 18:10:55 +00:00
Trevor Parscal 1ea3999e04 Fixed drop-down menu to match items more carefully
Change-Id: Ibd46861be243d2872f4edaa9a182d3931d4f9fab
2012-06-21 17:50:46 -07:00
Trevor Parscal 7af5af7683 Merge "Adjust oldRange in the rebuildNodes call as well" 2012-06-22 00:43:29 +00:00
Trevor Parscal 5af7c4d833 Merge "When trying to turn list items into headings, unlist them" 2012-06-22 00:42:51 +00:00
Catrope fb38655ff0 When trying to turn list items into headings, unlist them
This requires splitting the list and unwrapping the items

Change-Id: Ie77fe00d2396e4f7d2f1b28bfc0b0301255454a4
2012-06-21 17:41:58 -07:00
Catrope 62b78c9109 Adjust oldRange in the rebuildNodes call as well
This fixes a bug Trevor reported where selecting from a list item across
a heading and into a paragraph, pressing backspace, then clicking undo
caused an exception.

Change-Id: Id2851271529e10548f6979a030a198054aa1c48f
2012-06-21 17:26:17 -07:00
Trevor Parscal 35803f97ac Merge "You know what, just don't render hrefs, these links aren't clickable anyway" 2012-06-22 00:25:36 +00:00
GWicke a0d432bcd3 Merge "Added support for localsettings.js and improved logging of instance status" 2012-06-21 23:53:01 +00:00
Catrope a0d87989cf You know what, just don't render hrefs, these links aren't clickable anyway
Change-Id: If5f0c9a2fa41f09569195fe7807aba9a8207a3c9
2012-06-21 16:12:17 -07:00
Trevor Parscal b560924467 Merge "Use title for rendering internal links, and guard against undefined" 2012-06-21 23:04:11 +00:00
Catrope 6ddfc4bcab Use title for rendering internal links, and guard against undefined
Change-Id: I18a4e5e06303fcd9540fde8c3b21fe8f8887417e
2012-06-21 15:52:25 -07:00
Trevor Parscal f021b02ce1 Merge "Reconcile the order and completeness of textStyles in 2 different places" 2012-06-21 22:33:41 +00:00
Trevor Parscal 9f54bbfbfe Added support for localsettings.js and improved logging of instance status
Change-Id: Ia46ebb89fd704afe185ee13b726fb4ec044dff81
2012-06-21 15:29:40 -07:00
Catrope 9576f8fc48 Escape the href attribute on links
Change-Id: I3edaa5c9346f5c8c222c482bcb190acad2bac24d
2012-06-21 15:28:07 -07:00
Christian Williams 4f43ecefdf No need to apply selection in this transaction
Change-Id: Ia1ea5800dfbe5d89ef2fe22462712d8a558e5e3b
2012-06-21 15:20:21 -07:00
Inez Korczynski 41f5f7378b In Firefox hitting enter fires both events - keydown and keypress. We want to ignore key press for enter.
Change-Id: I49d19267cc6115342aadf11ea720e82bbf65ddb2
2012-06-21 14:52:43 -07:00
Catrope f58b5b6fc8 Reconcile the order and completeness of textStyles in 2 different places
ve.ce.TextNode listed textStyle annotations that didn't actually exist,
and failed to recognize some that did exist (such as span; bug 37808).

Added all annotations to both places. <span> tags are now tolerated by
the editor in that it doesn't crash anymore, but they're displayed (and
saved!) without any attributes, so <span style="color:yellow;">y</span>
doesn't show a yellow 'y' in the editor and is saved back as
<span>y</span> .

Change-Id: Iaae11ad5044150fa904010983ff83579cb37733d
2012-06-21 14:46:43 -07:00
Trevor Parscal ed33ca373f Merge "Undo and redo keyboard shortcuts" 2012-06-21 20:58:53 +00:00
Christian Williams 050134d55e Undo and redo keyboard shortcuts
Change-Id: Ia1e9db52f6fb2da79be28cdedaaf0dffc6097dc9
2012-06-21 13:58:21 -07:00
Catrope 3e16f8a91e Merge "Don't use custom handling for left and right arrow while metaKey is pressed as well." 2012-06-21 20:57:17 +00:00
Inez Korczynski 07760653b2 Don't use custom handling for left and right arrow while metaKey is pressed as well.
Change-Id: I7e2f73ab085b877169f4a29bec04a294d6e13a2a
2012-06-21 13:56:32 -07:00
Catrope e16346385d Actually block blocked users in the Parsoid API
Change-Id: I29b938bb5c1ea00886cb2b0ab04121e4d4cd1890
2012-06-21 13:55:33 -07:00