How does Atto work? | seems to be stripping out BS4 code

How does Atto work? | seems to be stripping out BS4 code

بذریعہ Derek Chirnside -
جوابات کی تعداد: 5

I've posted over here in the text editors forum, but got no reply: https://moodle.org/mod/forum/discuss.php?d=347847#p1403179

When I cut and paste any text (even a phrase) into Atto in some BS4 tabs (in WISWYG view) it instantly strips out some of the code vital to get the tabs working.

Under the hood, how does Atto work?  Does it not now know about some of the new BS4 stuff and removes it?

I'm not really a coder, not even a hacker.  I thought someone may have a suggestion.

What I want: Cut and paste the code into code view, then type/cut and paste in the panes in the other view.

-Derek

درجہ بندی کا اوسط: -
Derek Chirnside کے جواب میں

Re: How does Atto work? | seems to be stripping out BS4 code

بذریعہ Joost Elshoff -
Particularly helpful Moodlers کی تصویر Testers کی تصویر

I suppose your question has more to do with the overall HTML and CSS clean up policy than with the inner workings of the ATTO editor. I know Moodle cleans up any HTML and CSS from text, if it might conflict with site css or create other undesirable situations. It also seems to clean up styled and colored tables people created in Excel or Word, for the same reasons.

Joost Elshoff کے جواب میں

Re: How does Atto work? | seems to be stripping out BS4 code

بذریعہ Derek Chirnside -

Joost, where is the 'cleanup policy'??

I note this in the tracker: https://tracker.moodle.org/browse/MDL-56557  (What is closed by deferred mean?)

I have created a tracker item today: https://tracker.moodle.org/browse/MDL-58084

-Derek

Derek Chirnside کے جواب میں

Re: How does Atto work? | seems to be stripping out BS4 code

بذریعہ Derek Chirnside -

Joost, this is what I am seeing:


Any thoughts?  It seems to be cut and paste from another document that fails.  tYPING IS FINE.

-Derek

Derek Chirnside کے جواب میں

Re: How does Atto work? | seems to be stripping out BS4 code

بذریعہ Mark Sharp -
Core developers کی تصویر Particularly helpful Moodlers کی تصویر Plugin developers کی تصویر

Thanks for posting up the video. That really helped.

So, when you paste into atto, it is expecting some kind of formatting to come along with it. e.g. Pasting from Word or from a website. It identifies it as such and does some clean up, then pastes your text from the clipboard. And, actually that works. If you paste from a website, you don't lose all your formatting.

However, if you try to be clean and paste from a text editor, the clipboard doesn't having any formatting information, so atto runs a function called fallbackPasteCleanup (you can see this in your browser console if you have the dev tools open - usually F12 opens that). This cleanup seems to be a little more rigourous and applies this._cleanPasteHTML to all the content rather than just the pasted content.

If you save your text content as a html page, then paste from that html page loaded in the browser, you don't get the issue you have there.

I'm adding this info to the tracker item you raised.

درجہ بندی کا اوسط:Useful (1)