mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 13:01:31 +08:00 
			
		
		
		
	fix(highlights): new italic format not displayed
This commit is contained in:
		
							parent
							
								
									9a3f765d42
								
							
						
					
					
						commit
						04a7ad8d4e
					
				
							
								
								
									
										16
									
								
								src/public/app/widgets/highlights_list.spec.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								src/public/app/widgets/highlights_list.spec.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,16 @@ | ||||
| import { describe, expect, it } from "vitest"; | ||||
| import HighlightsListWidget from "./highlights_list.js"; | ||||
| 
 | ||||
| describe("getHighlightList", () => { | ||||
|     let widget = new HighlightsListWidget(); | ||||
| 
 | ||||
|     it("supports old italics", async () => { | ||||
|         const highlights = await widget.getHighlightList("This is <i>italic</i> text", [ "italic" ]); | ||||
|         expect(highlights.$highlightsList.html()).toBe("<li><i>italic</i></li>"); | ||||
|     }); | ||||
| 
 | ||||
|     it("supports new italics", async () => { | ||||
|         const highlights = await widget.getHighlightList("This is <em>italic</em> text", [ "italic" ]); | ||||
|         expect(highlights.$highlightsList.html()).toBe("<li><em>italic</em></li>"); | ||||
|     }); | ||||
| }) | ||||
| @ -203,7 +203,7 @@ export default class HighlightsListWidget extends RightPanelWidget { | ||||
|         // matches a span containing color
 | ||||
|         const regex2 = /<span[^>]*style\s*=\s*[^>]*[^-]color:[^>]*?>[\s\S]*?<\/span>/gi; | ||||
|         // match italics
 | ||||
|         const regex3 = /<i>[\s\S]*?<\/i>/gi; | ||||
|         const regex3 = /(<i>[\s\S]*?<\/i>|<em>[\s\S]*?<\/em>)/gi; | ||||
|         // match bold
 | ||||
|         const regex4 = /<strong>[\s\S]*?<\/strong>/gi; | ||||
|         // match underline
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran