Add keep_title_attr option. Some sites(AO3) use <a title="Translation">Foreign language</a>

This commit is contained in:
Jim Miller 2015-02-22 11:37:58 -06:00
parent edfcfb8dcc
commit 1d8b065261
4 changed files with 12 additions and 0 deletions

View file

@ -264,6 +264,10 @@ keep_summary_html:true
## kept. Useful for keeping extra colors & formatting from original.
#keep_style_attr: false
## If set true, any title attributes on tags in the story HTML will be
## kept. Some sites(AO3) use <a title="Translation">Foreign language</a>
#keep_title_attr: false
## Don't like the numbers at the start of chapter titles on some
## sites? You can use strip_chapter_numbers to strip them off. Just
## want to make them all look the same? Strip them off, then add them

View file

@ -503,6 +503,8 @@ class BaseSiteAdapter(Configurable):
acceptable_attributes = ['href','name','class','id']
if self.getConfig("keep_style_attr"):
acceptable_attributes.append('style')
if self.getConfig("keep_title_attr"):
acceptable_attributes.append('title')
#print("include_images:"+self.getConfig('include_images'))
if self.getConfig('include_images'):
acceptable_attributes.extend(('src','alt','longdesc'))

View file

@ -85,6 +85,7 @@ def get_valid_set_options():
'include_tocpage':(None,None,boollist),
'is_adult':(None,None,boollist),
'keep_style_attr':(None,None,boollist),
'keep_title_attr':(None,None,boollist),
'make_firstimage_cover':(None,None,boollist),
'never_make_cover':(None,None,boollist),
'nook_img_fix':(None,None,boollist),
@ -212,6 +213,7 @@ def get_valid_keywords():
'is_adult',
'join_string_authorHTML',
'keep_style_attr',
'keep_title_attr',
'keep_summary_html',
'logpage_end',
'logpage_entries',

View file

@ -248,6 +248,10 @@ keep_summary_html:true
## kept. Useful for keeping extra colors & formatting from original.
#keep_style_attr: false
## If set true, any title attributes on tags in the story HTML will be
## kept. Some sites(AO3) use <a title="Translation">Foreign language</a>
#keep_title_attr: false
## Don't like the numbers at the start of chapter titles on some
## sites? You can use strip_chapter_numbers to strip them off. Just
## want to make them all look the same? Strip them off, then add them