htmlText remove all line breaks

In my program, a user can enter any type of text using a RichTextEditor. The entered text has all its illegal xml characters replaced (< with & lt ;) etc.) This string is placed in an xml document. A component is custom, then receives the xml document, converts the html code in its original form and the applicable as the htmlText of a property control of text. This used to work properly. I need string conversions because there are some "metaStrings" which is not replaced according to certain criteria... which is the string {$DATE} would get replaced by the effective date when loading at a later date. As I said, used to work, and I had no problem display of text exactly as the user who created it. Now, for some reason, when I set the htmlText property, all line breaks are removed, of any type. < here > < p > < / p > < /li > < li > for fleas. Remains of formatting, has increased the font size, color, etc., but there is no line breaks.

I have my chiseled loading code and the following output:

public static void loadHtmlText(textControl:Text,_textData:XML,_replaceMeta:Boolean_=_false):void
{
trace ("loading text html in a text component, loading", textData);
var html:String = textData.Html.toString ();
trace ("after parsing a string", html);
If (replaceMeta)
{
trace ('replacing');
HTML = html.replace(/\{\$DATE\}/,textData.Date);
Add sequences additional meta here for replacement
}
trace ("after the replacement", html);
textControl.htmlText = html;


textControl.validateNow (); force a commit
trace ("value that was set', textControl.htmlText");
}

and the following output:

text html in a text component loading, loading
< data >
< html > & lt; TEXTFORMAT LEADING = "2" & gt; & lt; P ALIGN = "LEFT" & gt; & lt; FONT FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = "0" KERNING "0" = & gt; Line 1 & lt; / FONT & gt; & lt; /P & gt; & lt; / TEXTFORMAT & gt; & lt; TEXTFORMAT LEADING = "2" & gt; & lt; P ALIGN = "LEFT" & gt; & lt; FONT FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = "0" KERNING "0" = & gt; Line 2 & lt; / FONT & gt; & lt; /P & gt; & lt; / TEXTFORMAT & gt; & lt; TEXTFORMAT LEADING = "2" & gt; & lt; P ALIGN = "LEFT" & gt; & lt; FONT FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = "0" KERNING "0" = & gt; Line 3 & lt; / FONT & gt; & lt; /P & gt; & lt; / TEXTFORMAT & gt; < / Html >
NotSet < date > < / Date >
< / data >

after parsing a string
< TEXTFORMAT LEADING '2' = > < P ALIGN = "LEFT" > < FONT FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = '0' KERNING '0' = > line 1 < / POLICE > < /P > < / TEXTFORMAT > < TEXTFORMAT LEADING '2' = > < P ALIGN = "LEFT" > < FONT FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = '0' KERNING '0' = > line 2 < / FONTS > < /P > < / TEXTFORMAT > < TEXTFORMAT LEADING = "2" > < P ALIGN = "LEFT" > < FONTS FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = '0' KERNING '0' = > line 3 < / POLICE > < /P > < / TEXTFORMAT >

After replacing
< TEXTFORMAT LEADING '2' = > < P ALIGN = "LEFT" > < FONT FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = '0' KERNING '0' = > line 1 < / POLICE > < /P > < / TEXTFORMAT > < TEXTFORMAT LEADING '2' = > < P ALIGN = "LEFT" > < FONT FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = '0' KERNING '0' = > line 2 < / FONTS > < /P > < / TEXTFORMAT > < TEXTFORMAT LEADING = "2" > < P ALIGN = "LEFT" > < FONTS FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = '0' KERNING '0' = > line 3 < / POLICE > < /P > < / TEXTFORMAT >
set < TEXTFORMAT LEADING = "2" > < P ALIGN = "LEFT" > < FONT FACE = "listFont" SIZE = "10" COLOR = "#0B333C" LETTERSPACING = '0' KERNING '0' = > line 1Line, 2Line 3 < / POLICE > < /P > < / TEXTFORMAT >



Uh, oops, all the strings wordwrapped, makes it impossible to read. There were three blocks < P > < / p > adopted in
each of them said line 1 line 2 and line 3, respectively, and each of them must be on its own line.

After forcing the validation of the text control after setting this string, it has that one tag < P > < / p > with all the text inside... 2Line 1Line line 3.


Any ideas?

It worked before, I did was move the parameter text in its own function, insead of a function called by the method of my custom component's data provider.

Thanks for the help.

Wow, almost three months later, when my work schedule allows me actually to take over this problem, and I have the solution :-). It turns out, I don't know why, or if same Adobe knows about the bug, but if you have fonts using style sheets for all controls on your application, that is, I have a style statement request where I placed the police then redering text html of the text control is bug, usually just remove all line breaks. Why, I have no idea, he is simply. However, the same bug does not occur in the TextArea component. Still, I don't know why, seems silly to me, but as the solution to this problem, simply create a component TextArea, backgroundAlpha styles set to 0, its borderStyle to 'none', set the editable to false and boom, you have a component of scrolling text, which doesn't render the text html incorrectly.

Tags: Flex

Similar Questions

  • FTP Dreamweaver CC2015 removes all line breaks in the php files. How can I fix this problem?

    When I upload a php file. The ftp transfer removes all line breaks and creates a continuous line of unique text. I need to download the code with all the line breaks in the original php file correctly.

    I found the problem.

    FTP of Dreamweaver CC 2015 program is not compatible with Yosemite 10.10.5 on all ftp servers.

    The new version of FileZilla (v 3.14.0) is also not consistent.

    Fetch 5.7.5 is fully compatible with Yosemite. With Fetch, I can download the files without any problems successfully.

    In their update, Fetch mentioned that the problem is not with all servers.

    I host on Unix servers with HostGator AMD Opteron processors running on an OS GNU/Linux 64 - bit.

    If you run Yosemite and ftp of Dreamweaver is ruin your line breaks, then use Fetch until Adobe can fix their problem.

  • Remove all line breaks

    Hello

    When you paste Acrobat PDF files into InDesign, I often have a ton of extra newlines, I don't want to. Someone at - it a script to remove all the jumps of line in a block of text?

    Why you want to script?

    Just go find grep select request: multiple return unique back, and then click all change.

    Please make sure that you have selected the Option to search: story if you want to change the selected block of text.

    Shonky

  • Remove the line breaks in the HTML Source Code

    Is it possible to remove all line breaks in the code source HTML generated by Dreamweaver? After using the Dreamweaver design view window, I want to assure you that all the source code of the html page I created is going on a single line. Is there a simple way to remove all line breaks, or tell Dreamweaver to create the HTML code on a line?

    Ki Song says:
    > Is it possible to remove any line break in the HTML source code
    > generated by Dreamweaver? After the use of the design view window in
    > Dreamweaver, I want to assure you that all the source code for the
    > goes from html page I created on a single line. Is there an easy way
    > to remove all breaks online or tell Dreamweaver to create the HTML code
    > code on a line?

    http://www.TJKDesign.com/articles/whitespace.asp

    HTH,
    --
    Thierry
    Articles and tutorials: http://www.TJKDesign.com/go/?0
    Perfect FAQ page: http://www.TJKDesign.com/go/?9
    Templates CSS - P: http://www.TJKDesign.com/go/?1
    CSS tabs menu: http://www.TJKDesign.com/go/?3

  • Easy way to remove excess line breaks in txt, html, and epub files?

    Transfer to my e-reader to read web pages. I have to convert everything in epub, because the PDF files and djvus are designed for larger screens, and txt and html are not displayed correctly.

    In any case, some pages have a lot of extra newlines that are arranged for larger screens.

    I have to remove the line breaks to make it readable. I know that DevonTech wordservice works in txt, which I can convert it to Epub. Is there something that works in Epub itself? Is there something else that works in txt?

    Thank you.

    INTHE html, these line breaks appear to be either < br / > or < br / > where the paragraph breaks are < p >. So, it seems easier to edit files ePub in the editor, as the iWrite series Epub or the caliber, that the modification of the txts.

  • Remove all lines and insert them into Oracle can make performance worse?

    I m working in a project that I need to make a batch update regularly (every 4 months) of excel files. These files have doesn´t excellent key in their ranks.

    The development of a code that deletes all lines and inserts the entire base again is easier than one who checks in all the ranks of its primary key and if necessary update. (sometimes may be a key to 5 columns).

    My question is: if I delete all the rows in the tables of the insert it again, it will cause tablespace fragmentation and in a future loss of performance?

    Is there a way to avoid this?

    Thanks in advance

    Alexander

    This response helped me a lot.

    Thank you all

    Remove all lines and insert them into Oracle can make performance worse? -Stack overflow

  • Remove all lines except 10 random lines

    Hello

    How to remove all the lines in the JOBS table except 10 lines at random?

    Someone asked him before (not here...): http://stackoverflow.com/questions/10820105/t-sql-delete-except-top-1

    but I didn't get the answer, and I don't think it will work in PL/SQL.

    If the answer to StackOverflow's works in PL/SQL, I will be happy if someone explains me with a better example.

    If the answer to StackOverflow does'nt work in PL/SQL, I will be happy if somebody give me an example.

    Thank you!

    Try this

    delete from jobs where rowid not in (select rowid from jobs where rownum <= 10)
    
  • Delete all line break tags

    I have a page that contains approximately 100 line breaks that I have to delete. How can I do this quickly?

    Is there a way to return an article or page in plain text so have also several tags I need deleted?

    Find and replace (Ctrl + F).
    Research > current Document > Source Code

    --
    Nancy O.
    ALT-Web Design & Publishing
    www.Alt-Web.com

  • Remove all lines but more recent of each

    Hello

    I have a table with about 3.6 million lines and came up with an idea of how to improve the speed of a query. Basically, my idea was to create a query that took (finally to enter into a historic table) all records associated with a particular area, except for the 2 last because they are the only ones used. For example:


    SPORT |    DRIVE |    DATE
    ========================
    RONALDO FOOTBALL 8 JULY 09
    RONALDO FOOTBALL 11 JUNE 09
    RONALDO FOOTBALL 22 MARCH 09
    FEDOR MMA 10-SEP-09
    FEDOR MMA AUGUST 15 09
    FEDOR MMA 11 AUGUST 09

    The idea is that the last recordings of ronaldo & fedor would be removed somehow... All the things I've tried so far have been a disaster =)
    Thanks for any help.

    Mike

    The first step would be to create a select that adds a new column to your table that contains some sort of grade.
    Something like this:

    select sport,
        player,
        date,
        dense_rank () over (partition by sport, player order by date desc) rank,
        row_number() over (partition by sport, player order by date desc) nr
    from yourbigtable
    

    Rest can be support on this. The difference between the two columns is that grade will give the same number for identical dates, while row_number() will give a new number for each line by group.

  • Resizing Auto text in a bounding box (and remove the line break)

    I have a lot of certificates of completion of the course I create (using pre-made our graphic charts).  I set up some variables from my diapers and I use a data set to shoot in the person's name, the course title and date of a CSV file.  The text 'Name' encompassing that I created is set to a specific width and height (and must stay that way) with a font size of 94,22 pt; However, some names are REALLY long and are too big for the bounding box.  They dress up.  When I run the "data fusion", I need Photoshop to automatically resize the text in the bounding box so that it is not word wrap.

    For example, "Jane Doe" fits well in the box.  However, "Johnathan Cornelius Doe" is too long, and the word encapsulates.  Instead, I want Photoshop to the long name and simply its size down to fit properly in the lack of word envelope bounding box.

    I have about 200 of them to spend in Photoshop, print and send.  I really don't want to individually open each certificate to verify this last after that I have run through.  I just batch process and print batch.

    Is there a way to do this?  Please note that I have never made any script; so if this is the way it must take, I need to explain carefully and in simple terms.

    Thank you!

    OK, try this. Save the code in a text file with the extension .jsx below. Create an action that runs the script. Then, you can use this action with the batch command.

    #target photoshop
    var doc = activeDocument
    doc.activeLayer = doc.layers.getByName ('LastName')
    var ly = doc.activeLayer
    var before = ly.bounds[2]-ly.bounds[0]
    
    var amt = doc.width/before*100
    transText (amt)
    ly.translate (-ly.bounds[0], 0)
    
    function transText(amt){
        var idTrnf = charIDToTypeID( "Trnf" );
            var desc2 = new ActionDescriptor();
            var idnull = charIDToTypeID( "null" );
                var ref1 = new ActionReference();
                var idLyr = charIDToTypeID( "Lyr " );
                var idOrdn = charIDToTypeID( "Ordn" );
                var idTrgt = charIDToTypeID( "Trgt" );
                ref1.putEnumerated( idLyr, idOrdn, idTrgt );
            desc2.putReference( idnull, ref1 );
            var idFTcs = charIDToTypeID( "FTcs" );
            var idQCSt = charIDToTypeID( "QCSt" );
            var idQcsa = charIDToTypeID( "Qcsa" );
            desc2.putEnumerated( idFTcs, idQCSt, idQcsa );
            var idOfst = charIDToTypeID( "Ofst" );
                var desc3 = new ActionDescriptor();
                var idHrzn = charIDToTypeID( "Hrzn" );
                var idPxl = charIDToTypeID( "#Pxl" );
                desc3.putUnitDouble( idHrzn, idPxl, 0  );//259.646484
                var idVrtc = charIDToTypeID( "Vrtc" );
                var idPxl = charIDToTypeID( "#Pxl" );
                desc3.putUnitDouble( idVrtc, idPxl, 0.000000 );
            var idOfst = charIDToTypeID( "Ofst" );
            desc2.putObject( idOfst, idOfst, desc3 );
            var idWdth = charIDToTypeID( "Wdth" );
            var idPrc = charIDToTypeID( "#Prc" );
            desc2.putUnitDouble( idWdth, idPrc, amt);//1050.143628
            var idIntr = charIDToTypeID( "Intr" );
            var idIntp = charIDToTypeID( "Intp" );
            var idBcbc = charIDToTypeID( "Bcbc" );
            desc2.putEnumerated( idIntr, idIntp, idBcbc );
        executeAction( idTrnf, desc2, DialogModes.NO );
        }
    
  • Remove line breaks a query

    Hi all

    I'm writing an application using Oracle SQL Developer, and one of the fields contains notes. Unfortunately, there are several line breaks caused when a user presses the Enter key as they type notes in our system. The broken line is visible only when export us the data into excel to produce spreadsheets of performance analysis.

    Would it not possible to remove the line breaks (may substitute with a space) without updating the data in the database?

    I'm sorry if I should not have created a new thread, but I can't find the answer anywhere.

    Something like:

    REPLACE(notes, CHR(10), ' ')
    
  • Button to remove all empty lines

    I am trying to create an interactive form that has a button that adds lines for the user to enter questions and another to add follow-ups to the authorities. There are 3 different sets of these. However, we do not want to add a button to remove all lines, in order to allow the accidental deletion of data already entered.  I would like to create a button that deletes all empty lines, including all subforms.  Either that, or to save the document, would be deleted all empty lines - depending on what would be easier. Help, please!  It seems that this will be a complicated task and I'm not well versed in LiveCycle to figure this on my own.

    Thank you!

    In the object > range of liaison. I've included a screenshot on the forum.

    Niall

  • remove the line spacing of a string

    In the attached VI, I expected my output to a long chain, but instead, it's a chain with what looks like inserted line breaks. This is my output looks like:

    xx xx xx xx xx xx xx xx

    xx xx xx xx xx xx xx xx

    xx xx xx xx xx xx xx xx

    and what I want is:

    xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx

    Is there an easy way to remove the line breaks?

    Thank you

    Just do a "find and replace String" with LF as search string, empty string (or probably a space if necessary) as string to replace and replace all instances set to true.

    Hope this helps

  • Is DataBlDel() the best way to remove channel lines?

    Hello

    I try to delete specific lines in a block of channels and find that DataBlDel() is extremely slow. Of course, my channels is fairly long (~ 36e6 lines), but I find that it takes hours to remove a handful of lines. Is there a better way to do it?

    The code I use is listed here:

    Option Explicit

    I have Sun

    I have = 1

    <=>

    < 0="">
    Call DataBlDel("[]/Time",i,1)
    Call DataBlDel ("[]" / Time Delta ", i, 1")
    Call DataBlDel ("[] / Force load Pin (PST_002_FCE)", i, 1 ")
    On the other
    i = i + 1
    End If

    Wend

    Everything is very appreciated, advice

    PorridgeMan.

    Hi PorridgeMan,

    This task can be done loads faster.  First, the DataBlDel() command is working on multiple channels and multiple lines at once, so you call it many more times to you.  If the time of<0 rows="" are="" contiguous,="" the="" ideal="" approach="" would="" be="" to="" use="" the="" find()="" function="" to="" get="" the="" first="" row="" where="" time="">= 0 and use exactly a call DataBlDel() to remove all lines not valid 3 channels.  If the time<0 rows="" are="" not="" contiguous,="" then="" i'd="" recommend="" using="" the="" calculator="" approach,="" like="">

    L1 = NOC ("specifying")
    L2 = ONC ("/ time Delta")
    L3 = ONC ("/ Force charge Pin (PST_002_FCE)" ")
    IF L1 0 > AND L2 > 0 AND L3 > 0 tHEN
    Call FormulaCalc ("Ch (L3): = Ch (L3) + NoValue * (Ch (L1)")<>
    Call FormulaCalc ("Ch (L2): = Ch (L2) + NoValue * (Ch (L1)")<>
    Call FormulaCalc ("Ch (L1): = Ch (L1) + NoValue * (Ch (L1)")<>
    Call ChnNoVHandle (L1, L2 & "," & L3, "Delete", "XY", 1, 0)
    END IF

    Brad Turpin

    Tiara Product Support Engineer
    National Instruments

  • Remove the line from the Excel report when generating reports

    Hi all

    I try to delete whole lines of the report excel during the generation of the report in excel, but I'm not able to do this. Here I am attaching an excel template, in that I want to delete line no 3 to 5 How can I do this. I'm using LabVIEW 8.6 Report Generation Toolkit for Microsoft Office 1.1.3

    Thanks and greetings...

    If there is no function to generate report for simple operations like this, then use the palette of VBA macros to run this code snippet:

    'remove all lines between two rows inclusive '.
    Void DeleteRows (intTopRow As String, intLastRow As Integer)
    Range (cells (intTopRow, 1), (intLastRow, 1)). EntireRow.Delete xlShiftUp
    End Sub

    Import Excel module allows to load the .bas file then run Excel Macro with parameters 3 and 5.  Check your security settings if you get an error in the macro.

Maybe you are looking for

  • C50-B-14Z satellite - Wi - Fi does not work correctly

    I bought my laptop 1 week ago (Satellite C50-B-14Z), but the wifi does not work properly. Most of the time, looks like it's connected to my network without any problems. However, it does not work, I cannot surf the web. The router is new and all the

  • Netflix doesn't stream

    Or shortly after the last update Tvos, our generation of Apple TV 4 decided he's not going to sink not Netflix. The Netflix User Interface is mostly ok, not as catchy, but good enough.  When we choose content to display, appears the red circle of spi

  • Dynamic user LV 2011 events ignore when you're already handling a

    Hello I have a UI which fires def dynamic events to control a process. These events are handled in a vi running in parallel. Say that the user has decided to fire an event of 'start', which is handled by the event handler, and now I would like to tha

  • Problem of compatibility printer PhotoSmart C7280 with Mac OS 10.7 (lion)

    my printer hp photosmart c7280 all-in-one will work with the new mac os 10.7 (Lion)?

  • Duplicate IP address error at startup

    Original title: Start up error System. IP address conflict? Help please. I have an error at the beginning upward.   ". IP address conflict with another system on the network"what is it and how to fix it? I found two IP addresses, but I don't know if