markitup pseudo WYSIWYG editor

Mark threads with "[2.0]" for discussions about features in the longer-term future, "[1.6]" is for short-term. This is not the place for general discussions or plugin or template requests. Only features that are approved to happen by the core team should be listed here for better structuring.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

markitup pseudo WYSIWYG editor

Post by yellowled »

There is no perfect WYSIWYG editor for websites, and there most likely never will be. But markItUp comes pretty close, and I think we should look into adapting it for s9y, maybe even as a new default editor.

http://markitup.jaysalvat.com/home/

It's lightweight, jQuery-powered, supports a lot of markup syntaxes (including the ones we have plugins for), it's customizable and even has keyboard support.

YL
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: markitup pseudo WYSIWYG editor

Post by Don Chambers »

Nice! I like it!
=Don=
Manko10
Regular
Posts: 50
Joined: Sun Dec 26, 2010 4:58 pm

Re: markitup pseudo WYSIWYG editor

Post by Manko10 »

I'd suggest Aloha Editor as a new default WYSIWYG editor http://aloha-editor.org/
It's an HTML5 based WYSIWYG editor which solves many common problems other editors have such as copy and paste, proper frontend editing etc.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: markitup pseudo WYSIWYG editor

Post by yellowled »

Manko10 wrote:I'd suggest Aloha Editor as a new default WYSIWYG editor
Aloha is definitely an editor we should look at once we make the transition to full HTML5 support, if not sooner.

YL
Manko10
Regular
Posts: 50
Joined: Sun Dec 26, 2010 4:58 pm

Re: markitup pseudo WYSIWYG editor

Post by Manko10 »

[OT] When you make the change, will you also get rid of this useless and bloated XHTML syntax?
I know, many plugins (unfortunately) output some hardcoded XHTML, but I think the general blog should use normal HTML syntax. That makes things much easier and cleans up the code. XHTML syntax isn't of any use unless you deliver it as application/xhtml+xml and that's out of question for several reasons.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: markitup pseudo WYSIWYG editor

Post by yellowled »

Manko10 wrote:When you make the change, will you also get rid of this useless and bloated XHTML syntax?
Well. (BTW, I do not consider this to be off-topic at all.)

In my mind, I'd love to have s9y emit plain, semantically useful HTML without any inline clutter at all. For templates, that's in the pipeline with 2k11. For plugins, it's a bit more complicated, mainly for two reasons:

1. We're a small team. Rewriting all the code is a lot of work.
2. Backwards compatibility. Trying to maintain that is complicated, generating multiple code snippets for various purposes might not be desirable for performance reasons.

Let's put it this way: We are determined to make the switch to HTML5, and we'll try to find a decent solution for any s9y user. How decent that will actually be and which version of s9y will actually make that switch is hard to predict. :)

YL
Manko10
Regular
Posts: 50
Joined: Sun Dec 26, 2010 4:58 pm

Re: markitup pseudo WYSIWYG editor

Post by Manko10 »

Well, HTML5 is backwards compatible even with XHTML syntax, but it is not forward compatible. That is, we can't satisfy all people. Once the switch to HTML5 is done, we will break some compatibility. Old plugins with XHTML 1.0 output will still be compatible (though ugly), but people with XHTML templates cannot use the new Serendipity. XHTML 1.0 templates with HTML5 elements will not validate anymore, although no browser will have problems with it.

It is not possible to maintain all old hats. I guess a version 2.0 might be a good point to break some compatibility in order to modernize some underlying structure.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: markitup pseudo WYSIWYG editor

Post by garvinhicking »

Hi!

I definitely think we can get a working version that satisfies all requirements of all users.

I am not in favor though for dropping XHTML just "for the looks of the sourcecode", if that would mean breaking currently working functionality or "things". So just to rewrite the code to make it "<br>" instead of "<br />" would be a total waste of developer's time. Just to state the obvious, I guess you all meant similarly.

I'm definitely all hands for getting s9y on to the future HTML track and supporting things.

Using a different WYSIWYG editor is a bit of a pain due to the existing plugins hooking into the editors. We tried to abstract that as good as possible, you can see that by looking at the other existing WYSIWYG editors. But the integration of a media database and others things is a real hassle, and takes up a lot of time. So a new editor would definitely need to have a few specification goodies, not only that it's flashy HTML5 code inside.

Maybe as a first step aloha could be implemented as a plugin, and if goes along well, it can become a new editor in s9y of course. I'm not fixated to any WYSIWYG editor whatsoever. It just needs to work for editors that need a WYSIWYG editor (who are beyond help already, of course ;))

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: markitup pseudo WYSIWYG editor

Post by yellowled »

garvinhicking wrote:I am not in favor though for dropping XHTML just "for the looks of the sourcecode", if that would mean breaking currently working functionality or "things". So just to rewrite the code to make it "<br>" instead of "<br />" would be a total waste of developer's time.
Agreed. However, we're going to need a doctype based "switch" anyway to make 2k11 work as a default template. (See discussion before.)

Basically, we need a way to detect whether a blog is running 2k11 or an older template since 2k11 can not work as a fallback for those. Based on that, core and plugins should be able to emit either good ol' XHTML or HTML5 (which is not about <br> vs <br />, but about no longer having to use deprecated markup etc.)

YL
Manko10
Regular
Posts: 50
Joined: Sun Dec 26, 2010 4:58 pm

Re: markitup pseudo WYSIWYG editor

Post by Manko10 »

So just to rewrite the code to make it "<br>" instead of "<br />" would be a total waste of developer's time. Just to state the obvious, I guess you all meant similarly.
If it's just that, then yes.
What I meant is that when we switch to HTML5 we should also sooner or later abandon the XHTML syntax. HTML5 is compatible with the XHTML syntax (though "real" XHTML5 must have a different content type) but especially for new code it would also be a waste of deverloper's time to keep writing all the slashs for self-closing elements, the attributes for boolean attributes and what not just to produce a valid XML syntax.
And if a developer updates one of his plugins and stumbles over a <br/> then it is not a huge effort to change this to <br>. He doesn't need to go through all the code just for the sake of updating the syntax. But if he works on a line with XHTML syntax, then it's not a big deal to update that.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: markitup pseudo WYSIWYG editor

Post by yellowled »

Manko10 wrote:And if a developer updates one of his plugins and stumbles over a <br/> then it is not a huge effort to change this to <br>.
Here's the thing: Not only is <br/> perfectly valid in HTML5, some people actually prefer to use the slash syntax for self-closing elements. Obviously, those people prefer it since they are used to writing XHMTL syntax, but should we really dictate that for the sake of saving a few bytes? :?

YL
Manko10
Regular
Posts: 50
Joined: Sun Dec 26, 2010 4:58 pm

Re: markitup pseudo WYSIWYG editor

Post by Manko10 »

Here's the thing: Not only is <br/> perfectly valid in HTML5, some people actually prefer to use the slash syntax for self-closing elements.
Unfortunately yes.
Obviously, those people prefer it since they are used to writing XHMTL syntax
I was one of those XHTML guys as well. I considered the normal HTML syntax where I could emit some closing tags, didn't have to give all attributes a value etc. very unclean and ugly.
But some day I was fed up with all the bloat of the syntax. I learned the delightfulness of the HTML5 shorthand syntax and realized that

Code: Select all

<img src="foo.png" alt="bar" />
<input type="text" disabled="disabled" />
doesn't make anything clearer than

Code: Select all

<img src="foo.png" alt="bar">
<input type="text" disabled>
and also

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Foo</title>
    </head>
    <body>
        <div>
            <p>Bar</p>
            <p>baz</p>
        </div>
    </body>
</html>
isn't any clearer than:

Code: Select all

<!DOCTYPE html>
<head>
    <title>Foo</title>
<body>
    <div>
        <p>Bar
        <p>Baz
    </div>
or even

Code: Select all

<!DOCTYPE html>
<title>Foo</title>
<div>
    <p>Bar
    <p>Baz
</div>
in some cases. Far from it! The shorthand syntax is often easier to read than the XHTML syntax with all the unnecessary stuff in it.
but should we really dictate that for the sake of saving a few bytes?
Other question: should we dictate the XHTML syntax? Same thing. ;-)
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: markitup pseudo WYSIWYG editor

Post by yellowled »

Manko10 wrote:Other question: should we dictate the XHTML syntax?
No, and as far as I can see, we don't.

Personally, I appreciate the idea of writing clean, "proper" markup. I really do. But there are issues way more important than that, and I really don't think it's a good idea to waste time and energy on checking every single plugin for slash-style syntax.

What's the actual benefit? Performance? Not really by saving a few bytes. Readability? That's highly subjective. Or is it merely a matter of principle?

YL
Manko10
Regular
Posts: 50
Joined: Sun Dec 26, 2010 4:58 pm

Re: markitup pseudo WYSIWYG editor

Post by Manko10 »

No, and as far as I can see, we don't.
I think we do. <br /> might be valid HTML5, but not valid HTML 4.01. As I wrote in another thread here: there is much hardcoded HTML in s9y and especially in the plugins, so it is not possible to create valid HTML 4.01 templates with Serendipity.

However, if everything were smartified (which could be achieved by using the Smarty3 block syntax) we wouldn't force anything. If that's implemented, nobody will ever again need to discuss whether one should write slashes or not. ;-)

Again: it surely is a waste of time to modify all plugins just for the sake of removing or adding slashes. But in the name of consistency we should decide on one thing (which is used for new code and for code that's being modified anyway). Currently the standard is XHTML but since we're about to switch to HTML5 I think we should decide on the native HTML syntax. XHTML is a dead thing and actually, no one has ever used XHTML. All people have always written HTML with a wrong syntax (which therefore became part of a new standard as some sort of legacy syntax).
And should we ever come to that point where each and every piece of output can be overridden by templates or template blocks, then everyone who still likes his XHTML syntax can use that and we have a consistent syntax in both worlds: in the default templates and in the custom templates of XHTML junkies.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: markitup pseudo WYSIWYG editor

Post by yellowled »

Manko10 wrote:However, if everything were smartified (which could be achieved by using the Smarty3 block syntax) we wouldn't force anything.
So what you're actually suggesting is "Smartify everything". I'm with you on that, but I also know that there are valid performance concerns.
Manko10 wrote:Again: it surely is a waste of time to modify all plugins just for the sake of removing or adding slashes.
One could as well argue that it's a waste of time to smartify every bit of the s9y core just to enable proper markup in a disappearing standard. :)

I would love to see s9y switch to full smarty templating in frontend and backend, using a 3-layer model according to the structure/presentation/behaviour layer model. Imagine being able to easily modify any HTML, CSS and JS created by core components or plugins without having to dig through PHP code. However, I assume (Garvin or Timbalu can probably say more about that) there are still performance concerns. Other than that, "smartify everything" would be a substantial amout of work, which brings us back to time and energy.

YL
Locked