mirror of
				https://github.com/alrayyes/wiki.git
				synced 2025-08-07 15:21:03 +00:00 
			
		
		
		
	feat: openLinksInNewTab option for link transformer
This commit is contained in:
		
					parent
					
						
							
								b7ae7a99db
							
						
					
				
			
			
				commit
				
					
						7c01e8dde0
					
				
			
		
					 2 changed files with 7 additions and 0 deletions
				
			
		quartz/components/scripts
| 
						 | 
				
			
			@ -20,6 +20,7 @@ const isLocalUrl = (href: string) => {
 | 
			
		|||
 | 
			
		||||
const getOpts = ({ target }: Event): { url: URL; scroll?: boolean } | undefined => {
 | 
			
		||||
  if (!isElement(target)) return
 | 
			
		||||
  if (target.attributes.getNamedItem("target")?.value === "_blank") return
 | 
			
		||||
  const a = target.closest("a")
 | 
			
		||||
  if (!a) return
 | 
			
		||||
  if ("routerIgnore" in a.dataset) return
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue