[scribus-dev] why doesn't Autoquote follow links?
Gregory Pittman
gpittman at iglou.com
Fri May 8 14:25:20 UTC 2015
This was a question on the mail list a while back, so I did some looking
into this.
I had written a script I called extract_text.py that collected the text
content of a document. This didn't exactly detect links, but used
getAllText(), which does pull in all of the text following links. It
just pulls the text and carriage returns, not other characters, so
Autoquote.py needed another method. For this I used selectText(),
pulling characters, analyzing them one at a time, and comparing to
previous and following characters for the algorithm. selectText()
includes various control characters, so styles and so forth can be
maintained, but it stops at the literal frame that is named, even if linked.
Looking at 1.5.0 SLA files, it seems that Scribus uses 3 bits of
information. One is a unique frame ID number (ItemID), and then there
other tags for previous frame (BACKITEM), which has the ID of the prior
frame in a linked set, a value of '-1' if there is none, and similarly
there is a next frame tag (NEXTITEM), with its ID or '-1'.
So I think there would be two approaches to solving the following links
issue. One would be to modify selectText() so that it follows links, the
other would be to get access to the ItemID, NEXTITEM, and BACKITEM values.
Does anyone have an idea as to whether this is feasible?
Greg
More information about the scribus-dev
mailing list