This question is locked. New answers and comments are not allowed.
Hi there,
I am using the ASP.NET MVC Editor control in version 2011.2.712, to allow staff to edit an HTML email that is then sent to the customer. Email clients are notoriously bad at rendering HTML emails (the worst of all being Outlook 2007...) and I am targetting a wide range of email clients. This means I have to use the <font> tag rather than <span style="...">.
The issue is that on saving the edited text, the Editor control strips out all <font> tags and replaces them with <span> tags. This is great for general HTML, but not for HTML emails.
I found the bit of code in the source that does this, and have removed it. However, I'm wondering if an option to turn this on or off could be added to the editor?
In case you're wondering, the bit of code was in Serializer.js. This is the offending line:
I removed the font { ... } section, and this works great, but will make updating to the next version of the Telerik MVC controls tricky as we'll have to re-apply the change. Could an option to turn this behaviour on or off be added in a future version?
Cheers,
Ed
I am using the ASP.NET MVC Editor control in version 2011.2.712, to allow staff to edit an HTML email that is then sent to the customer. Email clients are notoriously bad at rendering HTML emails (the worst of all being Outlook 2007...) and I am targetting a wide range of email clients. This means I have to use the <font> tag rather than <span style="...">.
The issue is that on saving the edited text, the Editor control strips out all <font> tags and replaces them with <span> tags. This is great for general HTML, but not for HTML emails.
I found the bit of code in the source that does this, and have removed it. However, I'm wondering if an option to turn this on or off could be added to the editor?
In case you're wondering, the bit of code was in Serializer.js. This is the offending line:
var tagMap = { 'telerik:script': { start: function (node) { result.push('<script'); attr(node); result.push('>'); }, end: function () { result.push('</script>') } }, b: { start: function () { result.push('<strong>') }, end: function () { result.push('</strong>') } }, i: { start: function () { result.push('<em>') }, end: function () { result.push('</em>') } }, u: { start: function () { result.push('<span style="text-decoration:underline;">') }, end: function () { result.push('</span>') } }, font: { start: function (node) { result.push('<span style="'); var color = node.getAttribute('color'); var size = fontSizeMappings[node.getAttribute('size')]; var face = node.getAttribute('face'); if (color) { result.push('color:') result.push(dom.toHex(color)); result.push(';'); } if (face) { result.push('font-face:'); result.push(face); result.push(';'); } if (size) { result.push('font-size:'); result.push(size); result.push(';'); } result.push('">'); }, end: function (node) { result.push('</span>'); } }};I removed the font { ... } section, and this works great, but will make updating to the next version of the Telerik MVC controls tricky as we'll have to re-apply the change. Could an option to turn this behaviour on or off be added in a future version?
Cheers,
Ed
