scanrefs: remove term prefix from title
It can happen, that a title is defined as term in the following way: :term:`My title` This patch checks for it and strips the leading part and the last `. Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
This commit is contained in:
		
				
					committed by
					
						 Thomas Lamprecht
						Thomas Lamprecht
					
				
			
			
				
	
			
			
			
						parent
						
							0eb0c4bd63
						
					
				
				
					commit
					407f3fb994
				
			| @ -93,6 +93,9 @@ class ReflabelMapper(Builder): | ||||
|                     logger.info('traversing section {}'.format(title.astext())) | ||||
|                     ref_name = getattr(title, 'rawsource', title.astext()) | ||||
|  | ||||
|                     if (ref_name[:7] == ':term:`'): | ||||
|                         ref_name = ref_name[7:-1] | ||||
|  | ||||
|                     self.env.online_help[labelid] = {'link': '', 'title': ''} | ||||
|                     self.env.online_help[labelid]['link'] = "/docs/" + os.path.basename(filename_html) + "#{}".format(labelid) | ||||
|                     self.env.online_help[labelid]['title'] = ref_name | ||||
|  | ||||
		Reference in New Issue
	
	Block a user