jupyterlite-sphinx icon indicating copy to clipboard operation
jupyterlite-sphinx copied to clipboard

Fix incorrect regex usage instructions for `TryExamples` JSON configuration file

Open agriyakhetarpal opened this issue 1 year ago • 0 comments

Description

According to the JavaScript (ECMAScript) standard for regular expressions, forward slashes (/) need to be escaped properly through backslashes (\), which means that the current instructions in the documentation raise errors on popular regular expression checker websites such as https://regex101.com/ and https://regexr.com/. While they work on most browsers without issues since RegExp is supported almost everywhere and browsers likely escape the string on their own, I thought that updating the documentation here through this PR to adhere to the correct method of escaping special characters would be beneficial.

Additional context

  • See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions#escaping
  • xref to numpy/numpy#26745 where I observed this when disabling interactive examples from certain pages

agriyakhetarpal avatar Jul 29 '24 12:07 agriyakhetarpal