Unfortunately I would say the thing is broken for me,
various keys (e.g. j,k,f,g,h,l) result in editor actions instead of
characters being inserted.
On Sat, Jan 1, 2011 at 12:50 PM, Magnus Manske
Happy new year all!
Let me welcome you to this historical year (10 years of Wikipedia!
(pseudo-) WYSIWYG wikipedia editing.
For the impatient, add
to your vector.js, force-reload, and try any article, User, or
Wikipedia namespace page. Click the WYSIWTF tab, edit, and save (yes,
it does save. You are responsible for cleaning up if you make a mess
(I invite you to try my test article at
Now, this is not "real" WYSIWYG, but rather what I'd call "augmented
wikitext". You still edit wikitext, but some elements (headings,
links, images, and yes, template) are HTML-rendered for convenience.
Large templates are collapsed into the template name; double-click it
to show/hide the vast sea of parameters, which you then can edit like
normal wikitext. Likewise, double-click links or images to get
(currently quite limited) properties.
For this to work, wikitext is parsed into "augmented wikitext", which
is then edited, and rewritten to normal wikitext upon save. Therefore,
you can still enter wikitext directly, and it will "just work" (TM),
except it won't show directly in its rendered form in the editor.
Likewise, lots of wikitext markup is currently not parsed into an
augmented form; bold/italics, lists, and tables, among others, are
left untouched. I can do only so much for a demo :-)
The editor component is by far the weakest part of this demo. I looked
at CKedit, but it seemed too much work to adapt it for a demo than to
write my own editor, which I then did. To make my life easier, each
wikitext character (!) is its own <span> element, which might tax your
browser. Medium-sized articles work fine in Chrome on my MacBook Pro,
but YMMV. You can click into the text to position the cursor, move it
left and right with the cursor keys (not up or down!), type text,
delete or backspace, and use Enter for new line. That's it. No text
selection, not bold/italics buttons, no undo. All of which is entirely
feasible, but too much work for this demo.
Some things can't be done with the demo right now, such as changing a
template name, or resizing an image. Again, no technical reason, just
a man-hour one. You will certainly find many ways to break it, and
instances where it fails (correctly discerning whether and image if
local or from Commons is one).
What I would like is some discussion about
* if this approach (working pseudo-WYSIWYG instead of unattainable
perfect WYSIWYG) is the way to go
* if the code I wrote would be a suitable basis for a system we can
throw at the general public
* if anyone is willing to help me with that
As always, my code is GPL, and I would be more than happy if, in the
end, it would become "official" Foundation code, with staff that
supports it. Well, I can dream...
Wikitech-l mailing list
Wikitech-l mailing list