don't add ­ on word boundaries and strip it from tooltips
addresses #300
This commit is contained in:
		
							parent
							
								
									23733bd9fe
								
							
						
					
					
						commit
						3410a58cd9
					
				| 
						 | 
				
			
			@ -36,7 +36,8 @@ $$.remove = (selector, base = document) => {
 | 
			
		|||
      const padding = btn.offsetWidth - btn.clientWidth;
 | 
			
		||||
      const displayedWidth = btn.getBoundingClientRect().width - padding;
 | 
			
		||||
      if (btn.scrollWidth > displayedWidth) {
 | 
			
		||||
        btn.title = btn.textContent;
 | 
			
		||||
        const text = btn.textContent;
 | 
			
		||||
        btn.title = text.includes('\u00AD') ? text.replace(/\u00AD/g, '') : text;
 | 
			
		||||
        btn.titleIsForEllipsis = true;
 | 
			
		||||
      } else if (btn.title) {
 | 
			
		||||
        btn.title = '';
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -194,5 +194,5 @@ function tDocLoader() {
 | 
			
		|||
function tWordBreak(text) {
 | 
			
		||||
  // adds soft hyphens every 10 characters to ensure the long words break before breaking the layout
 | 
			
		||||
  return text.length <= 10 ? text :
 | 
			
		||||
    text.replace(/[\d\w\u007B-\uFFFF]{10}|[\d\w\u007B-\uFFFF]{5,10}[!-/]|((?!\s)\W){10}/g, '$&\u00AD');
 | 
			
		||||
    text.replace(/([\d\w\u007B-\uFFFF]{10}|[\d\w\u007B-\uFFFF]{5,10}[!-/]|((?!\s)\W){10})(?!\b)/g, '$&\u00AD');
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user