Paragraph converted to Line Break?

Last post 12-17-2009, 4:26 AM by gottwald. 4 replies.
Sort Posts: Previous Next
  •  12-16-2009, 5:27 AM 57777

    Paragraph converted to Line Break?

    I am using the CuteEditor for asp, latest version.
     
    Here is my problem: When I paste text into the cute editor field, paragraphs are alway covertet to line breaks. Looking at the generated html code I would expect to see <p>. However what I get is <br>. I have tried different things with the editor.EditorOnPaste Property, but don't see a change in behaviour. It even seems there is no change at all, even when I use editor.EditorOnPaste = "ConfirmWord", I do not get a question to confirm something.
     
    Here is my asp code
     
    <%
    '------------Beginn Texteditorfeld----------------
    Dim editor
     Set editor = New CuteEditor
     editor.ID = "detail"
     editor.Text = objRS.Fields("detail")
     editor.FilesPath = "/cute_editor_6"
     editor.EditorWysiwygModeCss = "../styles/main_style.asp"
     editor.ConfigurationPath = "/cute_editor/Configuration/kreartiv.config"
     'editor.ConfigurationPath = "/cute_editor/Configuration/einfach.config"
     'editor.ImageGalleryPath = "/Uploads"
     'editor.MaxImageSize = 50
     'editor.AutoConfigure = "Simple"
     'editor.Template= "Bold,Italic,Underline"
     editor.CustomCulture = "de-de"
     editor.EditorOnPaste = "PasteText"
     editor.AllowPasteHtml = True
     editor.BreakElement = "P"
     editor.FullPage = true
     editor.Width = 750
     editor.Height = 250
     editor.Draw()
    '------------Ende Texteditorfeld----------------
    '%>
     
    Here is the Text I am pasting from a word file:
     

    Ask the questions you need to ask

     

    Well consider the following key topics; business objective(s), anticipated impact of the project deliverables, expected quality standards, significant risks seen at this stage, key dates on the project horizon, key stakeholders (beyond yourself and the project sponsor), and any budgetary constraints that are likely. In addition you need to learn what style of communication and relationship this particular sponsor expects from you.

     

    First impressions really count so do your preparation well. If you conduct a good, professional, confident, first meeting with your project sponsor you will not only demonstrate your capability in a good light, but you will also provide a valuable service to the sponsor.

     

    There is a paragraph tag between each paragraph
     
    When I paste this text with the above settings I am getting this (from the html view)
     
    <p>&nbsp;</p>
    <p>Ask the questions you need to ask <br />
    Well consider the following key topics; business objective(s), anticipated impact of the project deliverables, expected quality standards, significant risks seen at this stage, key dates on the project horizon, key stakeholders (beyond yourself and the project sponsor), and any budgetary constraints that are likely. In addition you need to learn what style of communication and relationship this particular sponsor expects from you.<br />
    <br />
    First impressions really count so do your preparation well. If you conduct a good, professional, confident, first meeting with your project sponsor you will not only demonstrate your capability in a good light, but you will also provide a valuable service to the sponsor.<br />
    </p>
    Do you see the <br> instead of the <p> that I would like to see?
     
    What do I have to change to make this work?
    Any quick help is appreciated.

    Volker Gottwald
  •  12-16-2009, 9:41 AM 57791 in reply to 57777

    Re: Paragraph converted to Line Break?

    gottwald,
     
    I think the problem is caused by the content you copied is not using <p> tag. It uses <br> tags.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  12-16-2009, 10:28 AM 57795 in reply to 57791

    Re: Paragraph converted to Line Break?

    When I test this on your demo website
    http://cutesoft.net/asp/EditorOnPaste.asp?EditorOnPaste=ConfirmWord
    copy the text from Word, paste it into the CuteEditor field using the "Confirm" Word settings, I am getting this:


    <h2 style="margin: 10pt 0cm 0pt"><span lang="EN-US"><font color="#4f81bd" size="4" face="Cambria">Ask the questions you need to ask</font></span></h2>
    <p style="margin: 0cm 0cm 0pt" class="NoSpacing"><span lang="EN-US"><o:p><font size="3" face="Calibri">&nbsp;</font></o:p></span></p>
    <p style="margin: 0cm 0cm 0pt" class="NoSpacing"><span lang="EN-US"><font size="3" face="Calibri">Well consider the following key topics; business objective(s), anticipated impact of the project deliverables, expected quality standards, significant risks seen at this stage, key dates on the project horizon, key stakeholders (beyond yourself and the project sponsor), and any budgetary constraints that are likely. In addition you need to learn what style of communication and relationship this particular sponsor expects from you.</font></span></p>
    <p style="margin: 0cm 0cm 0pt" class="NoSpacing"><span lang="EN-US"><o:p><font size="3" face="Calibri">&nbsp;</font></o:p></span></p>
    <p style="margin: 0cm 0cm 0pt" class="NoSpacing"><span lang="EN-US"><font size="3" face="Calibri">First impressions really count so do your preparation well. If you conduct a good, professional, confident, first meeting with your project sponsor you will not only demonstrate your capability in a good light, but you will also provide a valuable service to the sponsor.</font></span></p>

    So it looks like the paragraphs are correctly converted to <p>. However there is more formatting than I want and need.

    When I do the same with "PasteText" I am getting this

    Ask the questions you need to ask <br />
    Well consider the following key topics; business objective(s), anticipated impact of the project deliverables, expected quality standards, significant risks seen at this stage, key dates on the project horizon, key stakeholders (beyond yourself and the project sponsor), and any budgetary constraints that are likely. In addition you need to learn what style of communication and relationship this particular sponsor expects from you.<br />
    <br />
    First impressions really count so do your preparation well. If you conduct a good, professional, confident, first meeting with your project sponsor you will not only demonstrate your capability in a good light, but you will also provide a valuable service to the sponsor.

    Here paragraphs are converted to <br>.

    In your description of the properties you say the following

    PasteText:  When you paste text into the editor, all HTML formatting is stripped except for paragraph marks. This option is ideal for content management systems where you want to import text from other word processors and strip off any strange formatting commands they included. 

    ... exept for paragraph marks ... I would expect they are converted to <p> and not to <br>

    So I don't think the original text has <br>. When I look at the text in a HexEditor I see "OD OA" which looks like carriage return ...

    Any help? Anything I can do to make my life easier?

    Thanks
     
    EDIT: The reason I would like to see <p> instead of <br> is the following: When you mark a line and format it as a headline via paragraph, the complete text ist changed. It only works, when you type a return in front and after the line of text. This can be a lot of work in a long text with many things to format. As far as I remember the older version did this some how ...

    Volker Gottwald
  •  12-16-2009, 12:54 PM 57797 in reply to 57795

    Re: Paragraph converted to Line Break?

    If you set editor.EditorOnPaste property to PasteText, all HTML formatting is stripped and line breaks will be <br>s. For your situations, please use PasteCleanHTML instead.
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  12-17-2009, 4:26 AM 57814 in reply to 57797

    Re: Paragraph converted to Line Break?

    Thanks, this worked.

    However I had to removde the line
    editor.AllowPasteHtml = True
    to make it work. With this line there was no change on what ever setting I used.

    And I still think this is a work-around and not a solution to a problem. I feel it would be better to insert a <p> instead of a <br> when you use
    editor.EditorOnPaste = "PasteText"
    unless you can explain other reasons why you don't do this.

    I hope for a change in a future release.


    PS: I have used Quick Reply to reply and it happende twice that short before finishing the typing the complete text disappeared from the field and I had to re-type. The thrid time I used an external edito to tyoe and then only pasted teh text and quickly oressen "Post". How come?


    Volker Gottwald
View as RSS news feed in XML