mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	more flexible heading regex
This commit is contained in:
		@@ -126,7 +126,7 @@ export default class TocWidget extends CollapsibleWidget {
 | 
				
			|||||||
    getToc(html) {
 | 
					    getToc(html) {
 | 
				
			||||||
        // Regular expression for headings <h1>...</h1> using non-greedy
 | 
					        // Regular expression for headings <h1>...</h1> using non-greedy
 | 
				
			||||||
        // matching and backreferences
 | 
					        // matching and backreferences
 | 
				
			||||||
        const headingTagsRegex = /<h(\d+)>(.*?)<\/h\1>/g;
 | 
					        const headingTagsRegex = /<h(\d+)[^>]*>(.*?)<\/h\1>/g;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Use jquery to build the table rather than html text, since it makes
 | 
					        // Use jquery to build the table rather than html text, since it makes
 | 
				
			||||||
        // it easier to set the onclick event that will be executed with the
 | 
					        // it easier to set the onclick event that will be executed with the
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user