You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							29 lines
						
					
					
						
							408 B
						
					
					
				
			
		
		
	
	
							29 lines
						
					
					
						
							408 B
						
					
					
				import Parchment from 'parchment'; | 
						|
 | 
						|
 | 
						|
class Break extends Parchment.Embed { | 
						|
  static value() { | 
						|
    return undefined; | 
						|
  } | 
						|
 | 
						|
  insertInto(parent, ref) { | 
						|
    if (parent.children.length === 0) { | 
						|
      super.insertInto(parent, ref); | 
						|
    } else { | 
						|
      this.remove(); | 
						|
    } | 
						|
  } | 
						|
 | 
						|
  length() { | 
						|
    return 0; | 
						|
  } | 
						|
 | 
						|
  value() { | 
						|
    return ''; | 
						|
  } | 
						|
} | 
						|
Break.blotName = 'break'; | 
						|
Break.tagName = 'BR'; | 
						|
 | 
						|
 | 
						|
export default Break;
 | 
						|
 |