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

InlineText element with HTML copied from Zoom includes offensive formatting code #191

Open
xyztextbooks opened this issue Sep 28, 2020 · 4 comments

Comments

@xyztextbooks
Copy link
Contributor

xyztextbooks commented Sep 28, 2020

If an instructor copies code from Zoom and pastes it into the TinyMCE editor for an inlineText element, the pasted code includes offensive formatting that causes the course page to appear corrupted. The offensive code is the class names (itemhdrdd dropdown itemsum), e.g.:

<div class="itemhdrdd dropdown">
<div class="itemsum">
 <p>Join Zoom Meeting Click Link below and Enter Password when prompted.<br /><a title="ZOOM LINK STATISTICS" href="https://zoom.us/j/2110416192?pwd=Qm4zYlJPNzJ2YXF6dno4cXMrYm9rQT09" target="_blank" rel="noopener">https://zoom.us/j/2110416192?pwd=Qm4zYlJPNzJ2YXF6dno4cXMrYm9rQT09<span class="sr-only openext">Opens externally</span></a></p>
 <p>Meeting ID: 211 041 6192<br />Password: 11235<br /><br /></p>
</div>
</div>

The best solution (of course) is for instructors to paste as plain text, but... Perhaps all class names should be stripped when the text is saved (or displayed).

@drlippman
Copy link
Owner

Where exactly is this getting copied from? It looks to me like maybe someone copy and pasted from one inlinetext item to another, and that was the source of the problem.

@drlippman
Copy link
Owner

It doesn't look like Tinymce has a built in "strip classes on paste" option, but there might be some way to wrangle something in.

@xyztextbooks
Copy link
Contributor Author

Oh. I see what you mean -- the unwanted classes suggest that the instructor copied the gear menu along with selected text!

It looks like there may be a tinymce option to force plain text pasting by default:

https://stackoverflow.com/questions/2695731/how-to-make-tinymce-paste-in-plain-text-by-default

But, of course, more users might be frustrated by the loss of pasted formats than are troubled by the error we saw today.

@drlippman
Copy link
Owner

Yeah, I saw that option, but agree the loss of format would be a bigger idea, plus it would probably break images and other stuff in the copied text too. There is a preprocessor option; it might be possible to strip out classes using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants