mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
more flexible heading regex
This commit is contained in:
parent
571cb6d0eb
commit
c60f25fb7c
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user