mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-30 19:19:03 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			493 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			493 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { Plugin, RemoveFormat } from "ckeditor5";
 | |
| 
 | |
| /**
 | |
|  * A simple plugin that extends the remove format feature to consider links.
 | |
|  */
 | |
| export default class RemoveFormatLinksPlugin extends Plugin {
 | |
| 
 | |
|     static get requires() {
 | |
|         return [ RemoveFormat ]
 | |
|     }
 | |
| 
 | |
|     init() {
 | |
|         // Extend the editor schema and mark the "linkHref" model attribute as formatting.
 | |
|         this.editor.model.schema.setAttributeProperties( 'linkHref', {
 | |
|             isFormatting: true
 | |
|         });
 | |
|     }
 | |
| 
 | |
| }
 | 
