Saturday 25 August 2012

And now... For a mono bug

Content > Any Document > RTE (Rich Text Editor) > enter any text and publish:
...Content is not in a correct format
Empty Multiline Textboxes are pre-appended with '\t' everytime an editor control with a Textbox
loads, this leads to corrupted RegEx filters, etc. upon saving.

This is a mono rendering bug. After the textbox opening tag is rendered, a new line is issued, and then,
System.Web/System.Web.UI/HtmlTextWriter.cs > OutputTabs() renders a single tab leading to corruption.
The TextBox, MultiLine generated <textarea> tag increases the Indent count by one. However, this is wrong and
when the opening <textarea> tag is closed a tab is issued inside the textarea which is of course rendered.

The culprit is line 214 in .../mono/mcs/class/System.Web/System.Web.UI.WebControls/Textbox.cs.
The simple fix is to comment out the line, and re-compile mono. There are also workarounds using a client side
script that scrubs the textboxes.

For now, I have locally re-compiled mono.
But in the alpha 4.7.2 linux release I will probably be doing either a client side script, or a wrapper class that overrides the
mono textbox (multiline) behaviour.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.