Eliminating the HTML but keep line breaks

I'm hosting public users to submit the text of a field "description". However, I must reject HTML when it is displayed. I found the HTMLEditFormat() function that does this, but I lose line breaks and paragraph breaks.

After the search this site for answers, I can't find a solution to keep the line breaks AND paragraph breaks while eliminating the HTML.

I tried the below functions, but all have a problem. The closest one is NOT in <!-xyz-> comments. It removes HTML, preserves the new paragraphs but NOT line breaks. I can not find a solution that makes all three.

<!-< PRE > < FONT FACE = "ARIAL" SIZE = "3" > #HTMLEditFormat (description) # < / PRE >->
#ParagraphFormat (HTMLEditFormat (description)) #.
<!-#Replace (description, "#chr (13) ##chr (10) # ',' < br >', 'all'") #->
<!-#Replace (HTMLEditFormat (description), "#chr (13) ##chr (10) # ',' < br >', 'all'") #->
<!-#REPLACE (ParagraphFormat (HTMLEditFormat (description)), "#chr (13) ##chr (10) # ',' < br > al l","" ") #->

The use of < PRE > is the only one that preserves the jumps of line, but since users enter text in a text box that uses the line feed. The result pushes the long string of text in the table on the right side of the screen... .it can be enormous. So if I had a solution to force text < PRE > back to the line, I would be done.

Thank you...-Tony

OK, I found a solution: I have relaized I could save version (inset) HTML-stripped of the description in the database first. I did it using:

<[^>]*>","","ALL")>

Then when displaying, this simple replace preserves there line breaks AND new paragraphs:
#Replace (description, "#chr (13) ##chr (10) #","")
(', 'all') #.

Hope this helps future forum watch-er to the-ERS. -Tony

Tags: ColdFusion

Similar Questions

  • How to keep line breaks in CSV, TXT doc then merge the data in CC?

    Hey,.

    There is a thread for this question, answered in 2009, then in 2014 (that wasn't there is still no ideal integrated solution):

    https://forums.Adobe.com/thread/415563?start=0 & tstart = 0

    But I was wondering if Indesign CC2015 made no progress in this regard...?

    Thank you

    Vanessa

    In simple, no words. With the exception of the variable QR codes, merge data has remained the same since that post.

    The current solution of:

    • put a delimiter in the source file, such as
      or | to represent the newline; then
    • Merge into a new indesign file and use find/replace to replace the separator for a line break

    Is always the simplest solution with the data merge.

    Data merge isn't the only way to import variable data. XML is another way, but the learning curve is steep. The rewards are worthwhile, but prepare to invest some many hours in learning!

    Otherwise, perhaps consider a third party plug-in which may be more appropriate than merge data.

    Rest assured, you are not alone. All I can suggest is to go to the feature request/Bug Report Form and the application as a feature request.

    Colin

  • CFGFWK-60850: the Test failed! CFGFWK-60853: A connection to the database, but no lines have been returned to the examination of the SQL query.

    Hi all..

    It's SOA 11.1.1.7... I created the schema and storage via RCU but when I try to configure JDBS schema components... his throw this error:

    CFGFWK-60850: the Test failed!

    CFGFWK-60853: A connection to the database, but no lines have been returned to the examination of the SQL query.

    I created 3 users of UCR and who were all successful, because I have no error... of these three alone is managed in the configuration tree SOA...

    No idea why like that...

    Thank you

    Aerts

    This that I solved it by installing EMP 11.1.2.2 with UCR and SOA 11.1.1.6...

  • How to edit an existing esign form that is inside a widget?  I need to change the form, but keep the widget.

    How to edit an existing esign form that is inside a widget?  I need to change the form, but keep the widget.

    Hello Damien,.

    If you talk about form fields in the Widget, then Yes, you can change them by going to the tab manage and click Edit opposite the name of the Widget under the Widgets section.

    Kind regards

    -Usman

  • Move the layer but keep anchor still

    Hi, I know that I can use the Pan behind tool to move a layer anchor point. Now for adjustment purposes that I need to move the layer, but keep the anchor point where it is... otherwise it changes the path of the animation. Is this possible?

    Kind regards

    Frank

    I guess you have your animation path and you want to change the position of the layer to this track. If you simply position keyframes adjust anchor point values in the timeline panel. You can click and drag on the values, so that you can see the movement of the layer from the path.

    If you have animated a layer by setting keyframes in the anchor point so that you can change the relative position of the layer by rubbing through the position values in the timeline panel.

    If you have animated the two position and anchor, then you can open the layer in the layer panel, reveal the path of the anchor, select all the keyframes of an anchor in the scenario, click and drag on any keyframes the anchor to drag all this without creating a new keyframe. You can see and move keyframes from the plug-in position which has properties of position in the layer window and do the same thing.

    You can use the same select all the keyframes in the technical timeline to recover and move a path any position in the composition window.

    If this doesn't give you a solution I don't understand your problem.

  • Substitute CellRenderer of the list but keep the default background color

    I set up a custom CellRenderer class to apply a different font when rendering a list. But the default background color disappeared as well. It was a pure white when the custom CellRenderer class was created.

    How could I apply the custom font for a list, but keeping the default background of display (dark and light gray on the lines of even / odd)?

    Thank you very much for your help!

    Implemented as a cellrenderer alternation. Then simply change the font.

  • Adding breaks of the hyper link with line break

    I am trying to add a hyperlink to my document. The text I'm tying is long and crosses a line break. I select the text and then add the hyperlink, which seems to work very well, but then when I export to PDF and then click on the link, the link is broken at the break.

    Does anyone knows how to fix this?

    Yes. It is not InDesign, that determines what the hyperlink is right there, but rather the 'smart' function Acrobat who sees an address "www" and reads the text to the right on the PDF file. Pass this function disabled in Acrobat , and it should work.

    You can confirm that you have actually exported your document with active hyperlinks (it's a toggle in the export to PDF dialog box).

  • delete the last character of line break

    How can I remove the newline character from the end of a string? (Note: there are several line break characters in the string). Thank you!

    This may or may not work, but it is worth it.

    If (right (Votrechaine, 1) is 10)
    Votrechaine = left (Votrechaine, 1, len (yourstring)-1);

  • Remove photos from the iphone, but keep on Macbook

    How to delete photos from my iphone 5s 9,32 to save space (GB), but keep them on my macbook?  Only the choice of icloud was "remove photos from all devices.

    This is how works iCloud photo library. It synchronizes all actions of all devices. To save space on your iPhone, select this option to keep a local library optimized photos.

    Otherwise, you can disable iCPL on your iPhone and go back to my photo stream to synchronize new images on your computer. Make sure that all your photos have been imported b before turning it off.

  • How do I delete photos on the iphone but keep them on ipad?

    How can I delete pictures on my iphone 6 but keep them on my ipad?

    If they are connected to the same ICloud, then everything you delete, I think I will delete in the next. But you can remove it and send it to your ICloud.

  • Find and replace the string function replaces line breaks when I only replaced spaces?

    I need to replace all instances of a space or a series of spaces to a line with commas (or tabs) multi string so I can throw in a worksheet.

    I use the regular expression [\s]+ and it works, but it is also to replace the end of lines (\r\n) too.

    How can I replace the spaces but leave the end of the lines intact?

    Right-click on the search string and to take '-' code display. Enter the space character (\s) correctly - you \\s right now.

  • Windows mail - how to remove the attachments, but keep the body of the text

    I use Windows Mail. I get e-mails with attachments that I want to throw, but keep the body of the email. Tried several options, but nothing seems to work. I have seen a few posts here and advise to send the email to yourself and all that. Is there a better way to do it?

    I've seen some ads for exractor tools... Are they any good at all? And all those cheap that anyone knows? Thank you!

    My OEX program (www.oehelp.com/OEX/) has a function that will remove attachments (and save them if you want) messages with a click of a single button that is much faster than to try to do it manually.  It has a number of other features as well.  It also works well on XP in Vista (32 bit only) for Windows Mail and OE.
     
    Steve
     
    "TheGodfather3" wrote in message News: cfe1d43c-da68-4f0e-b25a-61b2e57d3a89...

    I use Windows Mail. I get e-mails with attachments that I want to throw, but keep the body of the email. Tried several options, but nothing seems to work. I have seen a few posts here and advise to send the email to yourself and all that. Is there a better way to do it?

    I've seen some ads for exractor tools... Are they any good at all? And all those cheap that anyone knows? Thank you!

  • Is it possible to resize the document, but keep the content proportions?

    With scripts, there are currentDocument.resizeImage () and currentDocument.resizeCanvas (). ResizeImage() method stretches the image. The resizeCanvas() will resize the canvas but not change the size of the image.

    I'm looking to resize the canvas to a new format, but keep the aspect ratio of the content. Is there a way to do this?

    OK, I got it working!

    adjustedWidth = width;

    adjustedHeight = height;

    If (imageAspectRatio > targetAspectRatio) {}

    adjustedHeight = width / imageAspectRatio;

    }

    else {}

    adjustedWidth = height * imageAspectRatio;

    }

    currentDocument.resizeImage (adjustedWidth, adjustedHeight, null, resampleMethod);

    currentDocument.resizeCanvas (width, height, AnchorPosition.MIDDLECENTER);

  • SWF playing in the HTML but embedded video is not

    I have several short clips (.flv format) that I need to include in the SWF files that I can put in HTML pages.  For unrelated reasons, I first used Flash 8 and will run on our server to test with no problems.  I thought I was free on this House project!  But when I copied the contents of our QA server for test users, videos stopped playing.  Or to be more precise, the SWF played very well - original content (photos and audio embedded .wav) started playing, but when the timeline reaches the keyframe flvplayback, nothing is played.  At the end of these swf files are final photos and another audio file embedded .wav who played very well if you waited until the SWF hit these keyframes.

    So, I tried the following:

    1. create the SWF directly on the server QA, thinking that maybe I forgot something.  Same result.

    2. create the SWF using Flash Pro... mixed results

    • Creating fine. I go to control - test animation - in the browser and the video plays perfectly.  Note, that it plays by using the URL of the drive mapped instead of a web address.
    • Change the URL of the drive mapped to the URL of the html test content is created shows the same results as Flash 8 in this environment - the video itself plays (I have the display of text that changes at the appropriate intervals chronology) but the video itself does not play.
    • Import the video into html files from Dreamweaver CS6 I need finally to do, did not help either - same result - swf seems to play, but not video.

    I just can't understand why the first videos, created using Flash 8 and on the test server, no longer work when they are copied to the QA server.  There are script files that maybe I'm missing?  Videos are NOT embedded in the SWF file due to problems of synchronization with the video and audio components, but rather I was selection to disseminate their.  They are located in the same folder as the SWF itself.  Is there a setting from one system to the other needs to be changed?  Or something that I need to adjust to get the web URL to play against the address of the file?

    I use either 11 and what solution I come with MUST use either as this must play on specific systems and I can not change the browser (company policy).

    If you import it, you then enter the directory path at the beginning.

  • Result of the method of the component string has line break

    I really have a strange problem when she returns a string as a result of the method of one component and trying to release this. I always get an extra line break. Stripping does not help. Here are the minimum code to reproduce this behavior:

    -Component Definintion:
    < cfproperty name = "strtest" >
    < name cffunction = 'test' returntype = "String" >
    < cfreturn 'being' >
    < / cffunction >
    < / cfproperty >

    -CFM
    < cfset com = CreateObject ("component", "strtest") >
    < cfoutput >
    This should #com.test () # only one line
    < / cfoutput >

    When I execute the script via my browser (IE or FF), and I look at the source code so there is still a line break should not.

    This only happens when you call a method of a component... call for a simple function or even temporarily store the result in a variable does not bring to this behavior.

    I recommend you read through the other posts on these forums before posting
    your own questions, in the case where your problem is land.

    I answered someone other that having exactly the same question yesterday: you
    Add output = "false" in your statement of .

    --
    Adam

Maybe you are looking for