Richtexteditor allows you use maxHTMLLength or maxTextLength to limit the length of the user's input.