# HG changeset patch # User Jim Hague # Date 1553324377 0 # Node ID 6bd946700312d5d5460b1041490c2d9a6e35d7a4 # Parent a9b44500bd8c9bf9fb737ae0d6ba3b49afab1ae3 Only the first title should be converted to from sort to display order. Subtitles don't influence display order, so don't need to be touched. OK, I now have a subtitle with a comma ('Ring the Bell, Watchman'). If it was the main title I'd have to do something else, but it isn't, so for now... diff -r a9b44500bd8c -r 6bd946700312 abcfield.py --- a/abcfield.py Fri Mar 22 21:57:15 2019 +0000 +++ b/abcfield.py Sat Mar 23 06:59:37 2019 +0000 @@ -136,6 +136,8 @@ return res # Convert Title fields from sort to display, so Bat, The->The Bat. +# This only happens for the main title, i.e. the first title in a tune. +# Subtitles are not affected, as they don't influence sort order. def convertTitleToDisplay(t): p = t.rpartition(',') if p[1] == "": @@ -228,7 +230,7 @@ # Fields that go through Markdown must have HTML entities. mdfield = field.upper() in ['H', 'N']; res = convertAccents(res, False if mdfield else latex) - if field.upper() == "T": + if field.upper() == "T" and n == 1: res = convertTitleToDisplay(res) elif field.upper() == "K": res = convertKeyToDisplay(res)