mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 15:11:31 +08:00 
			
		
		
		
	fix(highlights): unable to navigate to italic links (closes #1555)
This commit is contained in:
		
							parent
							
								
									a44bf7fb49
								
							
						
					
					
						commit
						eb097ec1ea
					
				@ -7,10 +7,12 @@ describe("getHighlightList", () => {
 | 
				
			|||||||
    it("supports old italics", async () => {
 | 
					    it("supports old italics", async () => {
 | 
				
			||||||
        const highlights = await widget.getHighlightList("This is <i>italic</i> text", [ "italic" ]);
 | 
					        const highlights = await widget.getHighlightList("This is <i>italic</i> text", [ "italic" ]);
 | 
				
			||||||
        expect(highlights.$highlightsList.html()).toBe("<li><i>italic</i></li>");
 | 
					        expect(highlights.$highlightsList.html()).toBe("<li><i>italic</i></li>");
 | 
				
			||||||
 | 
					        expect(highlights.findSubStr).toContain("i:not(section.include-note i)");
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    it("supports new italics", async () => {
 | 
					    it("supports new italics", async () => {
 | 
				
			||||||
        const highlights = await widget.getHighlightList("This is <em>italic</em> text", [ "italic" ]);
 | 
					        const highlights = await widget.getHighlightList("This is <em>italic</em> text", [ "italic" ]);
 | 
				
			||||||
        expect(highlights.$highlightsList.html()).toBe("<li><em>italic</em></li>");
 | 
					        expect(highlights.$highlightsList.html()).toBe("<li><em>italic</em></li>");
 | 
				
			||||||
 | 
					        expect(highlights.findSubStr).toContain("em:not(section.include-note em)");
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
				
			|||||||
@ -222,6 +222,7 @@ export default class HighlightsListWidget extends RightPanelWidget {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        if (optionsHighlightsList.includes("italic")) {
 | 
					        if (optionsHighlightsList.includes("italic")) {
 | 
				
			||||||
            findSubStr += `,i:not(section.include-note i)`;
 | 
					            findSubStr += `,i:not(section.include-note i)`;
 | 
				
			||||||
 | 
					            findSubStr += `,em:not(section.include-note em)`;
 | 
				
			||||||
            combinedRegexStr += `|${regex3.source}`;
 | 
					            combinedRegexStr += `|${regex3.source}`;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (optionsHighlightsList.includes("bold")) {
 | 
					        if (optionsHighlightsList.includes("bold")) {
 | 
				
			||||||
@ -288,7 +289,8 @@ export default class HighlightsListWidget extends RightPanelWidget {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
            $highlightsList,
 | 
					            $highlightsList,
 | 
				
			||||||
            hlLiCount
 | 
					            hlLiCount,
 | 
				
			||||||
 | 
					            findSubStr
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user