Wedge

Public area => The Pub => Topic started by: as1pk on September 17th, 2011, 07:04 PM

Title: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: as1pk on September 17th, 2011, 07:04 PM
Is accumulating Editor in wedge like the one in wordpress a big deal? if not then please add a very nice editor like that in the wordpress in it.

we are sick of
Code: [Select]
[b][i][u][s][/s][/u][/i][/b]
etc etc. it just wastes a lot of time and users dont have that much time to spare.
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Arantor on September 17th, 2011, 07:46 PM
We have talked about it.

Thing is, there's already an editor that sort of does that built right into SMF (and thus Wedge)

Tell you what, though, there is one huge problem with using such an editor: security. Half of the security patches I've seen in WP in the last year are related to the editor. This is not a situation I really want to get into.
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Nao on September 17th, 2011, 08:00 PM
Yeah... To me, right now, the SMF editor is okay. It's not very good at importing data but really, most people wouldn't bother with that anyway. (I didn't even know if could be done.)

Totally off-topic but I can't bother to find the IE topic.
So, you know what I spent my day on...? IE6 compatibility :lol:
It's always a bitch... First you launch IE6 and notice something's broken and it's easy to fix. So you fix it. Then you're happy, but then you go to another page and something else's broken... Might as well fix it too. Only, it doesn't cooperate this time. And you end up wasting time rewriting the menu code to add an output buffer (!!) for IE6 and delete all whitespace, and then you notice that it'll only work on list tags that have no ul child... And there's no way to fix these... And then you say, why the hell did I waste my time on this shit to begin with?!

So I'm tempted (once again) to go back to the original version that sucked big time (adding vertical gaps between list items in the admin menu), and not bother. I don't know. Problem is, months ago it used to work (only 1-pixel vertical gap), now it's like 10 pixels... :-/
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Norodo on September 17th, 2011, 09:00 PM
I believe it was Sartre that once said "Hell is other browsers"
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Aaron on September 17th, 2011, 11:57 PM
Quote from Nao on September 17th, 2011, 08:00 PM
So, you know what I spent my day on...? IE6 compatibility :lol:
To be honest, I can't believe you're still spending time on it. :o
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Nao on September 18th, 2011, 12:08 AM
Yeah, I know, it's stupid... Considering less than 3% of the Western world uses it and I have no interest in catering for Chinese and Korean users... (Not that I don't *like* them... But I don't see any reason to bother until someone provides us with Chinese or Korean language files, to begin with.)

I'm not going to bother MUCH longer, but for instance I *had* to deal with IE7 because it still has minimal market share. (> Opera, I have to admit...)
Posted: September 18th, 2011, 12:06 AM

(Although it has to be said we only have country information for IE6... Given that IE7's share is less than IE6's, maybe IE7 is actually used more in Asia just like IE6.... Heck, I guess I should be checking out visitor stats for wedge.org. Excluding Baidu of course.)
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Arantor on October 5th, 2011, 01:24 AM
OK, back over this topic.

WYSIWYG has a place. Me personally, I'd never use it, I find the entire idea so imprecise it's unreal (and please don't tell me time's an issue, I make quite literally hundreds of forum posts some days.)

And SMF does have a WYSIWYG editor. Now, if SMF's editor were replaced with another editor, that'd be a different story entirely, because it would have the security issues as mentioned but also the improved functionality of a WYSIWYG editor that wasn't retarded.

Here's an interesting point: we actually discussed a bit back about ditching bbcode and using purely WYSIWYG instead. That's almost more practical than you'd imagine in a lot of ways, it would save a great deal of trouble in terms of processing for a lot of posts, the only real objection I raised wasn't even the implementation of security, or the increased bandwidth use - no, the only objection I raised was in fact concerning usability.

One of the perks of bbcode is that you can introduce quick codes for all kinds of things. Representing a spoiler, or a footnote, in HTML is frustrating if done in a WYSIWYG fashion. However, most users that use WYSIWYG will not use these features.

So, perhaps, there's room for an alternative. For posts made with the WYSIWYG editor, save them with a flag to indicate they came from WYSIWYG. For all other posts, flag them as using bbcode, and render appropriately from the database.[1]

You'd have to be careful about switching between the two, since you would want to do that from time to time, but no more so than is currently being used.
 1. Security's not a concern in any practical fashion. If access is granted to be able to manually override this parameter, it's also going to be able to manipulate the raw data anyway so that raw HTML could be injected, negating the pre-parser sanitisation rules that are currently in place.
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Nao on October 5th, 2011, 09:44 AM
Have no clue what you're looking into doing... :-/
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Arantor on October 5th, 2011, 11:00 AM
It was more speculative. Remember the discussion we had not that long ago about ditching bbcode entirely? The principle argument against doing it was because bbcode offers a highly convenient way to add new complex markup that wouldn't necessarily have an equivalent in HTML. Footnotes and spoilers are the main examples, as is quoting.

Now, the easy route to implementing a good editor is to apply the same process that SMF does: have the editor toggleable, but when toggling, do a conversion from HTML to bbcode for most of the HTML, and when going the other way, do only simple bbcode that has a direct HTML equivalent. quote bbc, for example, does not get converted when switching.

What I'm suggesting here is a more complex route that allows keeping bbc whilst getting most of the benefits of actually using a HTML editor.

For posts constructed entirely in a WYSIWYG editor, sanitise them on incoming and then proceed to save it in raw HTML, with a flag in the messages table to indicate that this is a raw HTML item. For these posts, we can safely avoid calling parse_bbc, thus giving us a speed increase.

For posts constructed using bbcode, or created in an environment where we've switched back and forth, we treat that as bbcode and do some decent conversion (better than is there currently).

My question: is that feasible? It sounds like it in my head, and it sounds like a more thorough approach than I'd originally planned to use (which was to drop the original editor, replace it with CKEditor and rewrite the html-to-bbc conversion routine to suit)
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Nao on October 5th, 2011, 07:06 PM
I'm not thrilled with not being able to switch back and forth. And how would we do amulets anyway?

Amulets are smileys. Amusing iPhone spellcheck.
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Arantor on October 5th, 2011, 07:42 PM
I'm not suggesting we disable switching.

I'm saying we do switching but if the post was purely done in WYSIWYG, save it in WYSIWYG and bypass BBC parsing.

Oh, and make switching more reliable in the first place...
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Nao on October 5th, 2011, 08:20 PM
But why only save as HTML the wysiwyg posts?
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Arantor on October 5th, 2011, 08:26 PM
Because they're already HTML.

Posts with bbcode likely cannot translate back and forth cleanly. E.g. Footnotes cannot be converted to/from HTML in any meaningful fashion.
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Nao on October 5th, 2011, 08:40 PM
Simple BBC like footnotes can be converted through a simpler function than parsebbc. Also if we can switch back and forth then wysiwyg posts are bound to have quote tags etc.
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Arantor on October 5th, 2011, 08:48 PM
Footnotes are not simple BBC, not when you convert back from HTML. Quotes are a similar case. And quotes are not converted to/from WYSIWYG in any of the systems that have BBC and WYSIWYG.

I also don't think most people use quoting, so the bulk of posts in most forums will be fine. But a post in pure HTML, if we know it's pure HTML, we don't have to pass it through a parser... We don't have to do anything other than output it.
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Nao on October 5th, 2011, 09:38 PM
What about smileys then?
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Arantor on October 5th, 2011, 09:54 PM
I don't know how to handle them yet.

Doing it how SMF does it, though, is a no-go, because their editor accepts the smiley but on conversion, converts it to a generic img tag. This has other consequences, not just the obvious one about taking more processor time to process, like users who have different smiley sets to the forum default.
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Nao on October 5th, 2011, 11:09 PM
Either way we will have to run parse_smileys methinks.
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Arantor on October 5th, 2011, 11:13 PM
Hmm, good point. See, I did say I hadn't thought it all out...
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Nao on October 6th, 2011, 12:25 AM
It's relatively fast, though, so it's not something that would be much of an issue.
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Arantor on October 6th, 2011, 12:27 AM
*nods* True enough. I'm fairly sure it's possible to determine whether a given img tag is an image or a smiley though...
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Nao on October 6th, 2011, 12:50 AM
And if we change the smiley or its set?
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Arantor on October 6th, 2011, 12:51 AM
That's the thing, if you process it at save time back into its smiley set, it stops being a problem.
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Nao on October 6th, 2011, 12:55 AM
And people disabling smileys?
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Arantor on October 6th, 2011, 12:57 AM
If it's pushed through parse_smileys, there's no difference between what there is now and having an HTML page that has smiley symbols in it. The one difference is that we can bypass parse_bbc if we know in advance the page is pure HTML.
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Nao on October 6th, 2011, 03:01 PM
Well... Actually... Now that I think about it, even if someone uses a different smiley set than the author's, it should show their own smiley set -- because Wedge uses divs with a class name, and the class name is the same in all sets... So I'm cool with that.

(Except I'm not sure anymore whether people can disable smileys at read time... In which case we'd have to do a preg_replace or something to delete smiley classes.)
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Arantor on October 6th, 2011, 03:16 PM
They can disable smileys at read time? First I've heard of it.

Smileys can be disabled at post time, which is cool, and I don't see that affecting the editor process much, if any.
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Nao on October 6th, 2011, 04:06 PM
Quote from Arantor on October 6th, 2011, 03:16 PM
They can disable smileys at read time? First I've heard of it.
Well, I'm not even sure whether they can change the smiley set... :P
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: Arantor on October 6th, 2011, 04:14 PM
Yes, they can provided we haven't removed or otherwise broken that code.
Title: Re: Is accumulating Editor in wedge like the one in wordpress a big deal
Post by: godboko71 on October 6th, 2011, 05:17 PM
Quote from Arantor on October 6th, 2011, 04:14 PM
Yes, they can provided we haven't removed or otherwise broken that code.
I know you where not suggesting to remove people being able to pick there smiley sets, however I am a-okay with it being removed.