Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can WYSIWYG Die?
#11
OK. Either way i am not sure why it is doing that. I dont believe its in class_parser anymore as it does it immediately when you paste it into the editor. MyBB's Javascript then?
Recommended Tutorials:
Reply
#12
testing with UserCP source mode enabled:


TABS:
class Klass:
def __init__(self):
pass

def test(self):
while blah:
if blah_blah:
if blah_blah_blah:
pass

class Klass:
def __init__(self):
pass 

def test(self):
while blah:
if blah_blah:
if blah_blah_blah:
pass 
SPACES:
class Klass:
   def __init__(self):
       pass
   
   def test(self):
       while blah:
           if blah_blah:
               if blah_blah_blah:
                   pass

class Klass:
   def __init__(self):
       pass 
   
   def test(self):
       while blah:
           if blah_blah:
               if blah_blah_blah:
                   pass 
Recommended Tutorials:
Reply
#13
Things were working and stopped working at some point, right? Tabs haven't been broken on MyBB forever.
Reply
#14
im not sure. I never tested tabs before this.
Recommended Tutorials:
Reply
#15
Neither have I, it just seems like there's been a huge uptick.
Reply
#16
its probably some class(s) or some editor that is using tabs by default
Recommended Tutorials:
Reply
#17
The not-replacing-tabs-with-spaces thing is my plugin's fault. I'm not sure why normal tabs aren't showing though...
I should have some time tomorrow, so I'll look into it.

EDIT:
It seems that the removing tabs thing is completely the WYSIWYG editor's fault, as they are removed on the client side.
Tabs that actually reach the server side are displayed correctly.

I would try figuring out what is going on, but SCEditor makes my head hurt.
The last time I tried writing a plugin for it (on a local MyBB install), to add support for our custom tags, it would get completely borked whenever I added... pretty much anything.
Reply
#18
if people want to use tabs in a WYSIWYG editor, then they need to specify what their tabs mean.  without the user specifying that then what the board operator specifies can be used.  without that the client side editor would do a little pop-up that tells the user that tabs have not been specified.

i dislike WYSIWYG for other reasons.  it makes life more difficult in many ways when in-line attributes like the [] tags are used.

properly designed, WYSIWYG can be nice.  with limited client side programming there is less such opportunity.  tabs + WYSIWYG could be just a spacing tool and might have a smarter meaning for python code, then the resulting code can just use spaces.  uploaded code would be a different issue (should we accept source files with tabs?).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#19
Another first-poster who was ruined https://python-forum.io/Thread-PyCharm-c...atted-code
Tabs aside (since this thread degenerated before), WYSIWYG and code don't work well on a programming forum. All the other code-oriented forums / Q+A sites I've seen require BBcode or markup or something.
Reply
#20
Ok so MyBB 1.8.X series is using WYSIWYG editor. I heard MyBB 2.0 will have the option to switch on/off WYSIWYG editor. But that is a long ways away. As is...You can only change the MyBB 1.8.x editor by reinstating it with another editor. Both of the following are plugin editors but have seen some bugs from users complaining about it. But they do not have WYSIWYG.

CKEditor
https://community.mybb.com/mods.php?action=view&pid=849

Yui Editor
https://community.mybb.com/mods.php?action=view&pid=554

im not sure what happens to our custom BBCodes if we change the editor via plugin. Not sure if they stay, or if we have to remake them, or if its not possible with the plugin. Wouldnt know until i try to implement it.

The other option is to keep it as it is, but switch everyones editor view to source mode by default. Everyone can do this already in their UserCP on a per user basis currently. But i mean to default new users to it and change the current. I believe this would just insert the BBCode of the copied formatted text making it obvious that it is formatted text to new users (not sure i would have to test this). But instead of HTML in python code tags, we would have BBCode then.

The other option is to somehow disable WYSIWYG editor in the core. Though this is ideal, I am not sure how to do this at all. It could result in a long drawn out testing ground again like the beginning.
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  WYSIWYG dead, source mode enabled metulburr 0 2,803 May-31-2017, 01:26 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020