Currently I am writing up some tutorials for my staff on how to use different aspects of wordpress. I need to display HTML in the knowledge base. But everything I've tried so far, doesn't seem to work. Every method seems to be overwritten the moment I save the entry. Escaping the "<" and other signs, putting code tags around the code and other embedding tags do not seem to work. Is there anything I am not seeing?

I believe that you are running afoul of the HTMLawed.  Please see the following thread:http://forum.osticket.com/d/discussion//bug-sanitzing-with-hmlawed-redactor-and-js-code-tag-in-frontend-is-ignored-and-will-be-rendered

Does it not work with <pre> tags? 

Like this

nope. sure doesn't. Redactor seems to break <pre> tags.. wtf? Hilariously, this forum uses cleditor, which hasn't been updated in years.. (2014).

It isn't redactor that is breaking html code, redactor actually does it properly but the library HTMLawed as ntozier mentions has a parameter that lets it decode html entities in to the actual character and that's what's breaking it in osticket per default, when editing the problem is that the characters are interperated multiply times, so you need to do an extra step for html entities in order for it to be output correctly.

It doesn't even send back though, it's broken as soon as you switch between html view and non-html view.. so, has to be redactor right?

If you enter the html in the normal view it's converted to html entities and you can see this in the html view, if you want to type it in html view you'd have to enter html entities instead of actual html code.

8 days later

As @[deleted]01 and @[deleted] mentioned, the problem is, that the code is sanitized in different locations, you have to adjust:js/redactor-osticket.phpinclude/htmLawed.phpinclude/class.format.phpIf you need empty tags, classes and styles you have to adjust these files, too.Here you can download the API instructions for redactor 10.2.5Here you can find the instructions for HTMLawed

2 years later

I see this is still an issue. I also see the issue appears to be on this forum as well as it looks like people have tried to post information to help but it's not there. Can anyone manage to post anything that can resolve this? Or can you simply not use certain symbols in the KB which frankly is a serious limitation? The fact that the code is double interpreted is pretty weak, I've never seen this issue ever in a piece of web software/ WYSIWYG editor.

Write a Reply...