Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a STACK admin option to force use of plain text editor, regardless of users' editor preferences #1208

Closed
sangwinc opened this issue Jun 26, 2024 · 10 comments

Comments

@sangwinc
Copy link
Member

TinyMCE is causing a lot of unpleasantness, messing up multilang content, LaTeX, JS etc. It is the default editor, and many new users do not know it's a problem. Indeed, why would they know and why would they expect anything other than flawless performance from the default editor!

Do we need an option at the STACK admin level to force use of plain text editor, regardless of users' editor preferences?

@aharjula
Copy link
Member

Well, we would then need to have some alternative way for people to attach pictures/files to the questions, "plain text editor" does not support that and this is often a problem leading to people switching between editors during the start of authoring of a question. It might be a bit too much to have a system setting that basically removes that capability from the authors.

But yes, TinyMCE has really messed up plenty of old multilang content (in my world), even outside STACK questions and people really were not ready for that. Luckily the multilang2 filter is relatively easily available, at least that uses syntax that is not being cleaned away.

I would suggest a setting that has three modes:

  1. Respect the user editor setting always.
  2. Detect sensitive content, and override the setting and display warning messages to explain. Maybe some extra tools (like the dollar converter) at the same time, for example, a tool for converting those multilang spans to STACK own [[lang]]-blocks, which would be safe from TinyMCE and after the conversion step maybe the question is no longer sensitive and could probably then be opened with whatever editor is active.
  3. Always plain text i.e. no file attachments.

Could almost make the second mode the default...

@christianp
Copy link
Contributor

What could you do to work with tinymce? Are you able to, instead of using plain-text tags for stuff you process, use HTML elements? Can you add buttons to the TinyMCE toolbar?

@timhunt
Copy link
Member

timhunt commented Jun 26, 2024

I would not try to decide that in a STACK bubble. I would discuss that with knowledgeable people in the Moodle space. E.g. Andrew Lyons, who can be reached through https://moodledev.io/general/channels#developer-chat or a relevant forum thread (not sure if that is the most relevant thread).

@anst-i
Copy link
Collaborator

anst-i commented Jun 26, 2024

We've had an issue with TinyMCE since it strips our multilang tags outside of

tags as this is technically not valid HTML. For multilang purposes it's much nicer to have the multilang outside of the

tags, so I don't want to give it up on my "wrong code" (which ends up being correct code after multilang has done its thing). I have complained here, let's see where the discussion goes: https://tracker.moodle.org/browse/MDL-82239

Alternatively if the plain editor could use a monospace font, that would already be helpful.

@sangwinc
Copy link
Member Author

I would not try to decide that in a STACK bubble. I would discuss that with knowledgeable people in the Moodle space. E.g. Andrew Lyons, who can be reached through https://moodledev.io/general/channels#developer-chat or a relevant forum thread (not sure if that is the most relevant thread).

Thanks Tim, yes, that's the correct approach of course in the first instance!

@LukeLongworth
Copy link
Contributor

I have a suspicion that this sort of admin option forcing my colleagues to use a plain-text editor rather than our default editor (currently still Atto for us I think) would cause more headaches than it's worth. Many of my colleagues are unfamiliar with HTML formatting, and would get confused if they were moved away from a WYSIWYG editor unexpectedly.

I had a read of the Moodle issue raised by Andreas and I'm hopeful that this suggestion:

A discussion can be had about giving admins the ability to toggle off Tiny's verify_html settings (on by default). This would allow users to submit malformed HTML, but we could handle it in a couple of different ways:

  • Show a warning when malformed HTML is used
  • Don't show any warning and allow the malformed HTML

would work fine here (particularly the former option).

I have other complaints/wishes for the plain text editor (I want monospacing, tabbing and context aware highlights that don't edit my code!) but that feels beyond the scope of this discussion.

@anst-i
Copy link
Collaborator

anst-i commented Jun 27, 2024

Agree on all points. Maybe we as a STACK community could try to make a push towards a slightly more advanced plain editor? (Yes, I'm well aware how contradicting that sounds)

@anst-i
Copy link
Collaborator

anst-i commented Jul 1, 2024

Other users are also not happy about TinyMCE interfering with code: https://tracker.moodle.org/browse/MDL-80953

@sangwinc
Copy link
Member Author

IT turns out this is a duplicate of issue #433 (from 2019) and we even started a solution in this branch
https://github.com/maths/moodle-qtype_stack/tree/iss433

@sangwinc
Copy link
Member Author

sangwinc commented Nov 8, 2024

OK, I added a stern warning to the editor form.

https://github.com/maths/moodle-qtype_stack/blob/dev/edit_stack_form.php#L199

That might help...

@sangwinc sangwinc closed this as completed Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants