View Single Post
Old 04-29-2012, 11:44 PM   #1
sr2012
Junior Member
sr2012 began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Apr 2012
Device: Kindle Touch
Question Error parsing templates when metadata fields have special characters like &, ' or ó

Am just playing around with templates so I can create a stand-alone library with a desired folder structure. Basically I would like to organize it by series if part of a series, else by authors. The template I am using is as below:
{series:'test($,eval('Series/{series}/{series_index:|| - }{title} ({authors})'),eval('Authors/{authors}/{title}'))'}

To test it out, I used it as the template for a composite column that I display on the Calibre GUI. It appears to work as expected, except where there are some special characters in the title or authors, e.g. when the title contains an apostrophe or if there are multiple authors separated by & or if the author contains characters like ó.

Not sure if there is a way to escape the field value when "eval"uating the template, so these special characters do not interfere with the template evaluation.

Pardon me if this is a newbie question, which I readily admit to being :-). I searched the forums and on google, but could not come up with anything that could help me solve this problem. Would appreciate any help fixing the above template to obtain the desired result or other suggestions to achieve the same objectives.

Thanks

Last edited by sr2012; 04-30-2012 at 12:27 AM. Reason: General issue
sr2012 is offline   Reply With Quote