#8432·openmct

Notebook search crashes on input with regex characters (unescaped RegExp in TextHighlight)

Author: soroush5Created Sep 4, 2026Updated Sep 5, 2026

Summary

Typing notebook search text that mixes letters with unbalanced regex characters (e.g. (a, [unclosed) crashes every matching entry's render with SyntaxError: Unterminated group / character class.

TextHighlight.vue highlightedText() drops the free-typed search string straight into new RegExp. The existing guard only prefixes a single backslash when ALL characters are non-alphanumeric, so any mixed input with regex syntax throws. Chain: NotebookComponent search @input (raw) → originalSearchTexthighlightText (NotebookEntry.vue:326) → TextHighlight:55. A Vue computed throwing mid-render takes down the results list.

Verified the exact logic in node: (a and [unclosed throw, plain text fine.

Expected

Escape regex syntax in the highlight text (standard escapeRegExp-style escaping) so arbitrary search input can never throw; matching behavior for plain text stays identical.