mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	small simplification in parsing
This commit is contained in:
		
							parent
							
								
									aec8083d0c
								
							
						
					
					
						commit
						15ff3df9df
					
				| @ -120,18 +120,20 @@ function html2notecase(contents, note) { | ||||
|             } | ||||
|         } | ||||
|         else { | ||||
|             let linkMatch = /^((https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/i.exec(curContent); | ||||
|             let linkMatch = /^(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]/i.exec(curContent); | ||||
| 
 | ||||
|             if (linkMatch !== null) { | ||||
|                 note.links.push({ | ||||
|                     note_id: note.detail.note_id, | ||||
|                     note_offset: index, | ||||
|                     target_url: linkMatch[1], | ||||
|                     lnk_text: linkMatch[1] | ||||
|                     target_url: linkMatch[0], | ||||
|                     lnk_text: linkMatch[0] | ||||
|                 }); | ||||
| 
 | ||||
|                 found = true; | ||||
|                 index += linkMatch[1].length; | ||||
|                 console.log(linkMatch[0]); | ||||
|                 console.log(linkMatch[0].length); | ||||
| 
 | ||||
|                 index += linkMatch[0].length; | ||||
|             } | ||||
|             else { | ||||
|                 index++; | ||||
|  | ||||
| @ -12,5 +12,6 @@ jQuery.hotkeys.options.filterContentEditable = true; | ||||
| $(document).bind('keypress', 'alt+ctrl+h', function() { | ||||
|     const toggle = $(".hide-toggle"); | ||||
| 
 | ||||
|     // use visibility instead of display so that content isn't moved around and stays set in place
 | ||||
|     toggle.css('visibility', toggle.css('visibility') === 'hidden' ? 'visible' : 'hidden'); | ||||
| }); | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 azivner
						azivner