File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ local default_config = {
73
73
{ " year" , " (%s) " , " " },
74
74
{ " title" , " %s" , " " },
75
75
}
76
- local title = require (" papis.utils" ):format_display_strings (entry , title_format )
76
+ local title = require (" papis.utils" ):format_display_strings (entry , title_format , true )
77
77
for k , v in ipairs (title ) do
78
78
title [k ] = v [1 ]
79
79
end
Original file line number Diff line number Diff line change 333
333
334
334
--- Creates a table of formatted strings to be displayed in a line (e.g. Telescope results pane)
335
335
--- @param entry table #A papis entry
336
+ --- @param use_shortitle ? boolean #If true, use short titles
336
337
--- @return table #A list of strings
337
- function M :format_display_strings (entry , format_table )
338
+ function M :format_display_strings (entry , format_table , use_shortitle )
338
339
local clean_results_format = self .do_clean_format_tbl (format_table , entry , true )
339
340
340
341
local str_elements = {}
@@ -370,6 +371,9 @@ function M:format_display_strings(entry, format_table)
370
371
end
371
372
table.insert (str_elements , table.concat (authors , " , " ) .. " (eds.)" )
372
373
end
374
+ elseif v [1 ] == " title" and use_shortitle then
375
+ local shortitle = entry [" title" ]:match (" ([^:]+)" )
376
+ table.insert (str_elements , shortitle )
373
377
else
374
378
table.insert (str_elements , entry [v [1 ]])
375
379
end
You can’t perform that action at this time.
0 commit comments