Placeholder Bug

ka
karl
Posts: 73
Joined: Mon Feb 07, 2011 12:54 pm
Platform: Mac

Fri Dec 01, 2017 9:19 am Post

There seems to be a bug in Scrivener 3 on how many times you can use auto-numbering placeholders to cross-reference. It seems you can only reference twice before Scrivener treats the reference as plain text. Addition of more references results in a refusal to compile (the compiler seems to be stuck in a loop).

Here is the results using the example given in Scrivener.

Input
Figure <$n:figure>, Figure <$n:figure>, Please see figure <$n#figure>
Output
Figure 1, Figure 2, Please see figure 2

Input
Figure <$n:figure>, Figure <$n:figure>, Please see figure <$n#figure>, figure <$n#figure>, figure <$n#figure>
Output
Figure 1, Figure 2, Please see figure 2, figure 2, figure <$n#figure>

As can be seen, the compiled text has not replaced the third cross-reference placeholder, it seems to see it as plain text.

Input
Figure <$n:figure>, Figure <$n:figure>, Please see figure <$n#figure>, figure <$n#figure>, figure <$n#figure>, figure <$n#figure>
Output
Will not compile when trying to reference the figure four times.

Is this a bug or am I missing something?

User avatar
KB
Site Admin
Posts: 20922
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Fri Dec 01, 2017 3:45 pm Post

This is indeed a bug. The code is using an accumulative length change in calculating what to search for next instead of the length change for the current loop, causing it to skip placeholders and throw an exception if it gets to a certain point. I've fixed this for 3.0.1 - thanks for reporting it.

All the best,
Keith
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

ka
karl
Posts: 73
Joined: Mon Feb 07, 2011 12:54 pm
Platform: Mac

Fri Dec 01, 2017 4:44 pm Post

KB wrote:This is indeed a bug. The code is using an accumulative length change in calculating what to search for next instead of the length change for the current loop, causing it to skip placeholders and throw an exception if it gets to a certain point. I've fixed this for 3.0.1 - thanks for reporting it.

All the best,
Keith


Thanks Keith. Sorry for my multiple posts. I posted it here first, then realised I should have put it in the Bug Hunt (so that is what I did). Then I realised you had a bug reporting system so I then used that. Sorry to have bombarded you with the same thing over and over.