This is a migrated thread and some comments may be shown as answers.

[Solved] whitespace

2 Answers 131 Views
Editor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
leblanc
Top achievements
Rank 1
leblanc asked on 24 Sep 2011, 07:51 PM
Is there any way to preserve whitespace whenever we bind data to the editor or view source to make changes the editor discards original format.

This makes it difficult to edit in source view and difficult to support something like markdown where whitespace is used in the language grammar.

lm

2 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 26 Sep 2011, 01:54 PM
Hello Leblanc,

There is no easy way to leave the whitespace as it is, because the content gets serialized from the existing DOM. You could, however, use a HTML beautification script in the source view, in order to make the life of your users easy (or perhaps even using CodeMirror to make the editing experience a charm?)

From your example, however, can be seen that whitespace is also removed from preformatted tags (<pre>), which is clearly a bug (since visual formatting is lost). I have logged this in the issue tracking system, and we'll strive to fix it soon.

All the best,
Alex Gyoshev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
leblanc
Top achievements
Rank 1
answered on 27 Sep 2011, 03:23 PM
thanks for creating a bug at least for pre tag whitespace lost.


When fixing this bug it maybe a good place to squeeze the following feature:

$("#editor1").data('tEditor').FormatOutput = false ;

http://docs.cksource.com/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options/FormatOutput

This will allow projects to use different syntax like markdown.  
Meaning is lost if \s\s are converted to &nbsp; like it is today.

Goal: provide the user the exact content entered.

Without this feature viewsource editing is cumbersome as well as custom pluggins that modify the source to inject server side behavior when rendering content to the users.




thanks,

lm

Tags
Editor
Asked by
leblanc
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
leblanc
Top achievements
Rank 1
Share this question
or