Allow leading and trailing spaces in tab_title_template by using quotes
Fixes #2332
This commit is contained in:
parent
ce308286df
commit
f9e8a4050c
1 changed files with 11 additions and 1 deletions
|
|
@ -798,11 +798,21 @@ def tab_fade(x):
|
|||
The separator between tabs in the tab bar when using :code:`separator` as the :opt:`tab_bar_style`.'''))
|
||||
|
||||
|
||||
def tab_title_template(x):
|
||||
if x:
|
||||
for q in '\'"':
|
||||
if x.startswith(q) and x.endswith(q):
|
||||
x = x[1:-1]
|
||||
break
|
||||
return x
|
||||
|
||||
|
||||
def active_tab_title_template(x):
|
||||
x = tab_title_template(x)
|
||||
return None if x == 'none' else x
|
||||
|
||||
|
||||
o('tab_title_template', '{title}', long_text=_('''
|
||||
o('tab_title_template', '"{title}"', option_type=tab_title_template, long_text=_('''
|
||||
A template to render the tab title. The default just renders
|
||||
the title. If you wish to include the tab-index as well,
|
||||
use something like: :code:`{index}: {title}`. Useful
|
||||
|
|
|
|||
Loading…
Reference in a new issue