Hello everybody reading this,
Okay, the TextConverter.importToFlow() and TextConverter.export() methods do understand some tags like <a>, <p>, <span>, etc. But is it possible to define custom tags (elements) and let the TextConverter.importToFlow() and TextConverter.export() methods understand/interpret these custom tags?
For example, say I have the following String which I would like to transform into a TextFlow instance.
var input:String = '<TextFlow whiteSpaceCollapse="preserve" version="2.0.0" xmlns="http://ns.adobe.com/textLayout/2008"><p><span>Hello </span> <span fontWeight="bold">World</span><span>.</span></p><custom title="custom title">This is in custom</custom> </TextFlow>';
As you can see at the end of the String, there is a tag <custom> with one attribute "title" and with CDATA content. Now if I let the TextConverter convert this String into a TextFlow, the whole <custom>-tag gets removed. How can I create a new CustomElement class (like for example a SpanElement class) and then inform the Importer about that class and its corresponding tag? Of course the same should work in the opposite direction. So assume I have a CustomElement, I would like to generate a <custom> tag on exporting the TextFlow.
Any ideas? Work arounds? Suggestions?
Thank you already.
Am I right, that this is a tricky question? No hints or attempts so far. Really no-one out there?
I guess I am not the only one who would like to extend the Importer (Exporter) by new tags, FlowElement's and FlowLeafElement's.