Hi,
We are evaluating 2.5.3. Couple of quick questions:
1. How to disable the HTML filter ? We would like to seed the community with a corpus
of internal docs, (thru rest), and would like to keep the 'src' tags intact.
2. How do conditionally disable the HTML filter, from within the context of a filter/macro ?
For example, we have a corpus of internal videos. We would like to develop a macro to embed the video,
but we see that the 'src' attribute is stripped from the html fragment returned by the
macro, making the effort moot.
Thanks much.
Best Regards,
-senthil
Hey Senthil,
Sorry for the delay, I'm not certain of the answer to your questions myself. I will trace through the code and update you when I have a solution for you. Thanks,
~Long
Hi Long,
any update on this?
tks
Sorry, completely overlooked this.
Unfortunately there's no way to disable the HTML filter, but you can remove tags from the admin console > spaces/community > settings > filters and macros > html filter.
There are some tags that can't be removed from there because of security vulnerabilities... if this is a trusted internal site, you can remove these from the list by editing the spring-renderContext.xml in your deployment.
~Long
Hi Long,
Thanks for the reply.
HTMLFilter proves to be a poster child for *always in the way*
Java world. At the minimum it needs to provide customization abilities
(over and above what it provides now) and the understanding of
what (X)HTML is, in terms of doing the *right* thing. Please read on.
Could not find spring-renderContext.xml, is it packaged in a jar ?
Well, hit a wall with HTMLFilter again in another scenario as well.
Here is the HTML snippet returned from my macro :
Actually could not paste it preserving the format, so attaching it as
text files.
html.from.macro.txt - html returned from the macro
html.rendered.txt - final html rendered after the filter pipeline in the
document.
In summary, whitespace between elements are translated into non
breaking spaces ( ) violating the content integrity and totally
spoils the rendered view with extra spaces.
I am 0 for 2 against HTMLFilter, in terms of getting things done. *sigh*
Also, encoded html entities get double escaped as well after the Filter.
Best Regards,
-senthil
Yes, this resides within the clearspace-X.X.X.jar, you'll need to unjar, make the modifications and rejar it.
I'm not quite following what the HTMLfilter did specifically to the code macro, sounds like it is removing the nbsp? To replicate the issue, would I take the contents of the first file attached and post it (should result in the contents of the second file)?
~Long
Hi Long,
Thanks for the reply.
Let me try to clarify, I had written a custom macro (installed as a plugin), which returns a string containing (x)html
as per the Macro interface requirements.
In my previous post, I had attached two files :
html.from.macro.txt - is the snippet of the string text (containing html) returned from the macro
html.rendered.txt - is the equivalent html snippet rendered in the doucment.
Best Regards,
-senthil
Senthil,
Just to confirm, are the nbsp's the only HTML that are being stripped-out/converted to spaces for you?
~Long
Hi Long,
Thanks for the reply.
Acutally the other way, spaces are converted to nbsps. They should
be rendered just as spaces and let browser deal with them, respecting
the convoluted whitespae rules of *TML. HTMLFilter converting them
to nbsps causing browser to render the spaces, causing the grief.
Another issue is it double escapes encoded html entities.
& becomes &
This HTMLFilter needs to be taken back to the drawing board and rebuilt
in my opinion.
Best Regards,
-senthil
Senthil,
The HTML Filter actually strips out HTML not converts content (such as &) into it's HTML representation & amp ; , this is actually a function of the editor... from my understanding we convert the content into HTML and let the browser deal with the rest.
I guess I am not completely understanding the issue here. My initial thought was the HTML filter was stripping out tags, except now it looks like the issue is the editor is insert tags. What are you trying to achieve, perhaps there is a better approach that we haven't explored yet.
~Long
Hi Long,
Thanks for the reply.
I see, is there a way to disable HTML filter in 2.5.4 ? Then I can test to
see whether or not HTML Filter is the culprit.
Here is a sample doc in html view, the whole doc is just a call
to my macro with a URL. The macro pulls content from that URL,
cleanses it and returns as macro output.
<body>
<p>
<a class="jive_macro jive_macro_cdc-macro" href="javascript:;" jivemacro="cdc-macro">
http://www.cisco.com/en/US/tech/tk652/tk653/technologies_configuration_example09186a00800a9a49.shtml
</a>
</p>
<p> </p>
</body>
Does the editor still in play at this point ? If so, I still think it is inconsistent with editor
consuming macro expansions and does the space to non breaking space conversion
and double escaping of entities, considering the output of typical macro is html.
Anyways, I appreciate your patience and support. If acceptable, please pass our
conversation to dev folks and solicit their opinion.
Thanks and Happy Holidays!
Best Regards,
-senthil
Senthil,
Unfortunately it's not possible to disable the HTML filter in Clearspace 2.5.4.
The macro output you supplied looks correct (see the output of working macros built into Clearspace such as the YouTube macro, they appear almost identically). Unfortunately I cannot forward this to our dev team to examine, but I can take a look to see if there's anything I notice wrong immediately. Could you supply me with a copy of your macro plugin along with a description of what it should be doing, and how it works.
~Long