johansatge / obsidian-automatic-table-of-contents

💠 An Obsidian plugin to create a table of contents in a note, that updates itself when the note changes
MIT License
116 stars 10 forks source link

💥 Could not render table of contents (Invalid regular expression: /[[/gs: Unterminated character class) #36

Open JasminoSD opened 5 months ago

JasminoSD commented 5 months ago

Greetings, Ever since the most recent update, whenever I try to generate a simple automatic table of contents, I get this message : 💥 Could not render table of contents (Invalid regular expression: /[[/gs: Unterminated character class)

image

Here is the code I am using : image

I am using Win 10, Obsidian 1.5.3. Here are the other plugins I use :

Automatic Table of Contents

cMenu

Colored Tags

Commander

Dataview

Homepage

Iconize

Linter

Metadata menu

Multi column markdown

Omnisearch

Pretty bibtex

Recent files

Ribbon divider

Smart typography

Sort and permute lines

Tag wrangler

Text extractor

Zotero Integration

JasminoSD commented 5 months ago

I've been able to reproduce this bug by opening my other (test) vault. The Table of contents also worked in it. But as soon as I updated the plug in the same error message started appearing.

johansatge commented 5 months ago

Hi! thx for the report.

Could you please paste the full markdown of a failing page?

JasminoSD commented 5 months ago

Here is the markdown text of a page where it fails (the table of content fails on all pages, so I opted to copy-paste a short one for convenience) :


date created: 2024-01-09 date modified: 2024-02-10 type:

Table of contents

AAQ - Comment gérer vos DOCUMENTS PERSONNELS Supports et témoins de la vie quotidienne

https://archivistes.qc.ca/produit/comment-gerer-vos-documents-personnels-all/

Johnny Decimal

https://johnnydecimal.com/

image

johansatge commented 5 months ago

Thanks! I can't reproduce, so I suspect there is a conflict with one of your plugins.

One thing I can suggest is enabling debug by adding debugInConsole: true to the table-of-contents block, and check the output in the dev tools (View > Open Toggle Developer Tools); there could be useful information there (you might need to close/reopen the document to see the debug output)

CleanShot 2024-02-22 at 20 39 32@2x

JasminoSD commented 5 months ago

I am not sure if I am looking in the right place, but I have this warning (but it may be regarding the other tab : HOMEPAGE)

image


By turning all plug-ins off and on again, I have pinpointed the issue : It seems this plug in, when enabled, causes an error with Automatic Table of Content - https://github.com/sandrofigo/obsidian-pretty-bibtex