Skip to content
This repository has been archived by the owner on Nov 2, 2019. It is now read-only.

TinyMCE HTML Is Sometimes Stripped #111

Closed
maxdumas opened this issue Jun 4, 2015 · 9 comments
Closed

TinyMCE HTML Is Sometimes Stripped #111

maxdumas opened this issue Jun 4, 2015 · 9 comments
Assignees

Comments

@maxdumas
Copy link
Member

maxdumas commented Jun 4, 2015

Just tried to submit a details field on an event with <ul> and <li> tags and they were stripped from the submitted HTML, even though they were supported by the editor. (The button was available in the toolbar and the WYSIWYG worked.) @ethanresnick any ideas why this might happen? Could it be an issue on the API's side?

It's worth noting that wrapping <p> tags in the submitted HTML weren't stripped.

@ethanresnick
Copy link
Member

@maxdumas Can you try POSTing/PATCHing to the api directly, without going through the intranet ui, in order to isolate the culprit? I don't think it's the api, but I'm not sure.

@maxdumas
Copy link
Member Author

As an update: It looks like TinyMCE on the front end is actually never generating the correct HTML/binding it to the model in the first place. Looking at the source window in the actual editor shows that no real HTML is generated. So this is definitely a front-end issue. Whether or not it's an issue with our code or angular-tinymce I'm going to look into now.

maxdumas pushed a commit that referenced this issue Jun 12, 2015
Fixed a typo that incorrectly joined the elements of the
allowedTags array as passed into valid_elements.

Resolves #111
@maxdumas
Copy link
Member Author

Ethan made a typo. :)

@maxdumas maxdumas self-assigned this Jun 12, 2015
@ethanresnick
Copy link
Member

#ethanfail

@ethanresnick
Copy link
Member

P.S. Attributes are still getting stripped

@ethanresnick
Copy link
Member

@maxdumas Any idea why this is still happening?

@ethanresnick
Copy link
Member

This bug may be caused by/related to the TinyMCE textarea showing up even on some fields that don't take HTML. For example, I just loaded the related clubs add form, and the "Name" field was a tinymce input, even though the API docs return allowedHtml: null for that field, which should make this test fail.

Note: the API docs are not consistent. Sometimes, plain-text-only fields have allowedHtml: null and other times their description simply doesn't have an allowedHtml key at all. (The difference comes from whether the field's been explicitly marked on the backend as not allowing HTML.) But, in either case, the intranet should not use a Tinymce field.

@maxdumas
Copy link
Member Author

maxdumas commented Jul 2, 2015

The check against allowedHtml is for a truthy value, so it shouldn't give a false-positive if it is undefined. That said, check out edit for related clubs versus add. Now that is weird. I'm going to make a separate issue for that.

@maxdumas
Copy link
Member Author

maxdumas commented Jul 2, 2015

Closing this as the issue it identifies has been resolved. See #118 and #119 for follow-up issues.

@maxdumas maxdumas closed this as completed Jul 2, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants