PDA

View Full Version : Pasting XML



Ken L
June 11th, 2017, 23:43
I have a quick little script where I can copy some text from a PDF and it will edit the clipboard contents to automatically apply FG formatted text XML to my specification when I paste it.

I tend to end up with things like:

<b>Room 34-C</b>

Instead. Within the db.xml, I see



&#60 ;b&#62 ;Room 34-C&#60 ;/b&#62 ;


I suspect the action of pasting in FG is doing some sanitation? If so that's kind of disappointing. I'm not going to write a script that alters my db.xml for various reasons, or write an extension to circumvent it, unless there's some way to disable it, thought I doubt that given how it could do wonky things.

Trenloe
June 12th, 2017, 00:13
The formattedtextcontrol (https://www.fantasygrounds.com/refdoc/formattedtextcontrol.xcp)does not accept markup - which is set directly in the underlying data in the XML by the FG application. It needs to do this so that you can use greater than/less than signs, etc. without FG thinking you're using markup.

You cannot paste XML markup, or rich-text formatting, into the FG interface - the only way to change the formatting is via the right-click menus or shortcut keys.

If you want to paste XML markup then you'll have to do it directly into the underlying XML. Back the XML up before you do this, in case something breaks.

Ken L
June 12th, 2017, 01:54
I figured as much, I had it such that it parsed traps/treasure/dialog and what not for easy copy+paste during the transfer.