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

Forum decodes HTML entered as Encoded HTML #73

Closed
Timo-Breumelhof opened this issue Feb 22, 2021 · 3 comments · Fixed by #74
Closed

Forum decodes HTML entered as Encoded HTML #73

Timo-Breumelhof opened this issue Feb 22, 2021 · 3 comments · Fixed by #74
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Timo-Breumelhof
Copy link
Contributor

Timo-Breumelhof commented Feb 22, 2021

Describe the bug

The Forum Decodes HTML entered in the WYSIWYG editor (with the intention to show it as text).
This prevents users from posting code in the forums (is being stripped converted from text, so encoded HTML to HTML, right now)

Software Versions

  • DNN: 09.08.01
  • Module: 06.05.01

To Reproduce

Steps to reproduce the behavior:

  1. Create a post (with HTML allowed in the forum settings)
  2. In the CKEditor post <span>test</span> (not in the Source)
  3. Save the post, you will see test rendered by the forum
  4. Edit the post, you will only see "test" in the CkEditor, but the span has been placed in the HTML source instead of stored as encoded HTML.

Expected behavior

Encoded HTML should not be converted, but left as entered

@Timo-Breumelhof Timo-Breumelhof self-assigned this Feb 22, 2021
@Timo-Breumelhof Timo-Breumelhof added the bug Something isn't working label Feb 22, 2021
@Timo-Breumelhof
Copy link
Contributor Author

Timo-Breumelhof commented Feb 22, 2021

IMO the Decode on this line should be removed.

var strMessage = HTMLDecode(text);

After that <p>text</p> stays HTML encoded and is saved the way it should be.
But when you Edit the text after that, the HTML is decoded again (in the editor), not sure if that's by module or CkEditor.

@WillStrohl
Copy link
Member

I'm not sure I understand what's happening here. Maybe something is missing the Steps to Reproduce? 🤔

@Timo-Breumelhof
Copy link
Contributor Author

@hismightiness ok, edited, better now? BTW I found one part of the fix, working on the other part..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants