This problem is not fixed, if you enter the following in html view
<root>
<tag alias="abc" placementid="1835003" />
<tag alias="def" placementid="1835003" />
</root>
then switch between design and html view, the xml is modified and wrong.
I found a solution
function OnClientLoad(editor, args) {
editor.get_filtersManager().add(
new RadEditorCustomFilter());
}
RadEditorCustomFilter =
function () {
RadEditorCustomFilter.initializeBase(
this);
this.set_isDom(false);
this.set_enabled(true);
this.set_name("RadEditor filter");
this.set_description("RadEditor filter description");
}
RadEditorCustomFilter.prototype =
{
getHtmlContent:
function (content) {
newContent = content.replace(/&/gi,
"&");
newContent = CloseToEmpty(newContent)
return newContent;
},
getDesignContent:
function (content) {
newContent = CloseToEmpty(content)
return newContent;
}
}
if (Telerik.Web.UI.Editor) {
RadEditorCustomFilter.registerClass(
'RadEditorCustomFilter', Telerik.Web.UI.Editor.Filter);
}
function CloseToEmpty(content) {
var newContent = "";
var ii = 0;
var inOne = 0;
var startCount = 0;
var endCount = 0;
for (ii = 0; ii < content.length; ii++) {
if (content[ii] == "<") {
inOne = 1;
startCount = ii;
}
if (inOne == 1 && endCount < startCount && content[ii] == " ") {
endCount = ii;
}
if (content[ii] == "/") {
//check if previous was self closing
if (inOne == 1 && (ii + 1) < content.length && content[ii + 1] == ">") {
//time to change and get tag name
inOne = 0;
var tagname = "";
if (endCount > startCount) {
tagname = content.substring(startCount + 1, endCount);
}
else {
tagname = content.substring(startCount + 1, ii);
}
newContent +=
"></" + tagname;
}
else {
newContent += content[ii];
}
}
else {
newContent += content[ii];
}
}
return newContent;
}