diff --git a/defaults.ini b/defaults.ini index 5e62ef4..499075b 100644 --- a/defaults.ini +++ b/defaults.ini @@ -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 Foreign language +#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 diff --git a/fanficdownloader/adapters/base_adapter.py b/fanficdownloader/adapters/base_adapter.py index 38f425e..68ef3e3 100644 --- a/fanficdownloader/adapters/base_adapter.py +++ b/fanficdownloader/adapters/base_adapter.py @@ -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')) diff --git a/fanficdownloader/configurable.py b/fanficdownloader/configurable.py index 89617f1..7e71bf6 100644 --- a/fanficdownloader/configurable.py +++ b/fanficdownloader/configurable.py @@ -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', diff --git a/plugin-defaults.ini b/plugin-defaults.ini index fc8c2a2..e8a7512 100644 --- a/plugin-defaults.ini +++ b/plugin-defaults.ini @@ -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 Foreign language +#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