htmlToMarkdown: remove escapes when comparing content and link
This commit is contained in:
		
							parent
							
								
									039e5ed7bb
								
							
						
					
					
						commit
						4d8d36eaf6
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -58,7 +58,10 @@ function whenYouWalking(tree, images = true, embed = true) {
 | 
			
		|||
 | 
			
		||||
      if (link == null || !link.startsWith("http")) {
 | 
			
		||||
        str += content;
 | 
			
		||||
      } else if (content == link || link.replace(/^https?:\/\//, "") == content) {
 | 
			
		||||
      } else if (
 | 
			
		||||
        content.replaceAll("\\", "") == link ||
 | 
			
		||||
        link.replace(/^https?:\/\//, "") == content.replaceAll("\\", "")
 | 
			
		||||
      ) {
 | 
			
		||||
        str += embed ? link : `<${link}>`;
 | 
			
		||||
      } else {
 | 
			
		||||
        str += `[${content.replaceAll("\\", "")}](${embed ? "" : "<"}${link}${embed ? "" : ">"}${
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue