athens icon indicating copy to clipboard operation
athens copied to clipboard

Invalid regular expression error

Open juniusfree opened this issue 4 years ago • 5 comments

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 avatar Feb 19 '21 10:02 juniusfree

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

juniusfree avatar Feb 19 '21 23:02 juniusfree

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

juniusfree avatar Feb 26 '21 09:02 juniusfree

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...

wbkang avatar Mar 16 '21 00:03 wbkang

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.

derek-j-pitman avatar May 06 '21 00:05 derek-j-pitman

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

NickyNOS avatar Feb 03 '22 16:02 NickyNOS