athensresearch / athens

Athens is no longer maintainted. Athens was an open-source, collaborative knowledge graph, backed by YC W21
https://athensresearch.github.io/athens
Other
6.31k stars 397 forks source link

Invalid regular expression error #668

Open juniusfree opened 3 years ago

juniusfree commented 3 years ago

Problem

To replicate:

  1. Create a new page with a bold title (e.g. [[**new page**]])
  2. Open the page
  3. Remove the "**"
  4. Click outside the textarea

Another way to replicate:

  1. Search for a block using block reference using this value: ((**))
  2. Click any of the blocks that will appear on the inline search

Screenshots/Demo Error on page title: image

Error on inline search for block image

I investigated for a bit and it looks like this is related to the linked function in patterns.cljc. https://github.com/athensresearch/athens/blob/566c678bcfdf486641e0cf4cd2ab3957f0e65761/src/cljc/athens/patterns.cljc#L6-L10

Athens Version 1.0.0-BETA.40

juniusfree commented 3 years ago

Additional observation: The empty page name is saved after editing. Is this an expected behavior? image

juniusfree commented 3 years ago

This might be a related case: https://discord.com/channels/708122962422792194/802652338619285594/814786308798414888

wbkang commented 3 years ago

This is probably the same issue - when you open the "find or create a page" dialog then type "C+", you will get the same error. Seems like the fix is being merged soon...

derek-j-pitman commented 3 years ago

I've observed similar issues typing a slash followed by a parenthesis. See the following screenshot:

image

The app becomes unresponsive after throwing this error message.

NickyNOS commented 2 years ago

I am having the same issue when deleting a page named TODO\

[Window Title]
Athens

[Content]
message=Uncaught SyntaxError: Invalid regular expression: /(\[{2})TODO\(\]{2})|(#)TODO\|(#\[{2})TODO\(\]{2})|(\({2})TODO\(\){2})/: Unmatched ')'
source=file:///C:/Users/nisilva/AppData/Local/Programs/Athens/resources/app.asar/resources/public/js/compiled/renderer.js
lineno=15429
colno=471
error=SyntaxError: Invalid regular expression: /(\[{2})TODO\(\]{2})|(#)TODO\|(#\[{2})TODO\(\]{2})|(\({2})TODO\(\){2})/: Unmatched ')'

[OK]

image

Version 2.0.0-BETA.15