1

What is the best way to convert a tlf markup to HTML? I want only standar HTML without the old font tag. I think I saw a utility created by someone for this, but I can remember where it is. any ideas?

Tks.

oscarm
  • 2,630
  • 6
  • 41
  • 74

1 Answers1

0

http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3_Flex/WSc3ff6d0ea7785946579a18b01205e1c5646-7fef.html

var ptext:String = "Hello, World"; 
var flow:TextFlow = TextConverter.importToFlow(ptext, TextConverter.PLAIN_TEXT_FORMAT); 
var out:XML = TextConverter.export(flow, TextConverter.TEXT_LAYOUT_FORMAT, ConversionType.XML_TYPE );

but use TextConverter.TEXT_FIELD_HTML_FORMAT instead of TextConverter.PLAIN_TEXT_FORMAT

Eugene
  • 2,226
  • 1
  • 14
  • 15
  • thanks for the response. The problem with this method is that it returns very very very old HTML, with the "font" tag. I want standard HTMl with paraghas and styles. – oscarm Sep 10 '10 at 02:12
  • yeap, @vov11 it's bad but I think with core functions we will not get better export. You could write additional e4x parser to replace old font tags to CSS style as you want. let me know. – Eugene Sep 10 '10 at 07:18