Add the @ sign in the other order
This commit is contained in:
		
							parent
							
								
									4591b5ae03
								
							
						
					
					
						commit
						c084aa0156
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -108,9 +108,9 @@ turndownService.addRule("inlineLink", {
 | 
				
			||||||
		if (node.getAttribute("data-channel-id")) return `<#${node.getAttribute("data-channel-id")}>`
 | 
							if (node.getAttribute("data-channel-id")) return `<#${node.getAttribute("data-channel-id")}>`
 | 
				
			||||||
		const href = node.getAttribute("href")
 | 
							const href = node.getAttribute("href")
 | 
				
			||||||
		let brackets = ["", ""]
 | 
							let brackets = ["", ""]
 | 
				
			||||||
		if (href.startsWith("https://matrix.to")) brackets = ["<", ">"]
 | 
					 | 
				
			||||||
		if (href.startsWith("https://matrix.to/#/@")) content = "@" + content
 | 
					 | 
				
			||||||
		content = content.replace(/ @.*/, "")
 | 
							content = content.replace(/ @.*/, "")
 | 
				
			||||||
 | 
							if (href.startsWith("https://matrix.to")) brackets = ["<", ">"]
 | 
				
			||||||
 | 
							if (href.startsWith("https://matrix.to/#/@") && content[0] !== "@") content = "@" + content
 | 
				
			||||||
		return "[" + content + "](" + brackets[0] + href + brackets[1] + ")"
 | 
							return "[" + content + "](" + brackets[0] + href + brackets[1] + ")"
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue