backdrop-contrib / tinymce

Integration for the TinyMCE editor in Backdrop CMS
https://backdropcms.org/project/tinymce
GNU General Public License v2.0
2 stars 1 forks source link

Add option to set paste_as_text as default #87

Closed yorkshire-pudding closed 14 hours ago

yorkshire-pudding commented 7 months ago

I thought I would suggest this here first, but if you think it is not appropriate, I'll perhaps add a Wiki page about how to do it.

If pasting in text from MS Word, it tends to include some unnecessary Word classes. With the menu bar it is possible to set "Paste as Text" as the setting, which fixes this. It is also possible to set this as default in the options:

   "tiny_options": {
        "plugins": "accordion advlist autoresize charmap code codesample emoticons pagebreak fullscreen help backdropimage backdroplink insertdatetime lists searchreplace table visualblocks visualchars wordcount",
        "toolbar": "bold italic blockquote | styles | bullist numlist outdent indent pagebreak | alignleft aligncenter alignright | backdroplink backdropunlink | backdropimage | fullscreen",
        "menubar": "edit view insert format tools table help",
        "paste_as_text": true,
        "contextmenu": "backdroplink backdropimage backdroplistprops",
        "pagebreak_separator": "<!--break-->",
        "menu": {

I wonder if this setting is a reasonable candidate for the settings form?

indigoxela commented 7 months ago

@yorkshire-pudding many thanks for starting this discussions.

To clarify: not only via menu item this behavior can be toggled, but there's also a toolbar button available. tiny-toolbar-section-paste-text

Whether toggling the default behavior to "text" is a good candidate for the builder... I couldn't tell, honestly. How common is it to prefer pasting as text, possibly even hiding the option to prevent toggling?

It is - as (almost) any extended Tiny option - available in custom profiles. But that's JSON, which might be a hurdle for less technical site builders.

yorkshire-pudding commented 7 months ago

I don't know how common it might be. On a site I'm building, a lot of the information is in Word, and I was having to switch the option on for each node. I then found out about the switch and modified the settings to set it by default; made it much easier.

My guess is this scenario could be common, but that is just a guess.