Do I edit user input or leave it as is?

I am designing desktop application. In that application user can edit name of model or component.

The question is do I prevent user from entering garbage text (such as paragraphs of text) that will cause application to look ugly on some occasions or do I somehow edit the text by removing new lines and reducing number of characters.

I am afraid that if I do some editing user might be frustrated by the application.

Currently the application works on rule "garbage in garbage out" that means if you enter ugly text that is what you get in return.

P.S. Ugly text do not cause any errors in the application and is totally valid model or component name.