**Steps to replicate the issue** (include links if applicable):
* Open https://meta.wikimedia.org/w/index.php?title=Special:MyPage/global.js&action=edit
* Enter `'<script>'` or `"<script>"`
* Click "Show preview"
**What happens?**:
> MediaWiki internal error.
>
> Original exception: [b3766e42-894a-44bc-bf04-31f11b3d6c8d] 2024-03-17 10:36:39: Fatal exception of type "DomainException"
>
> Exception caught inside exception handler.
>
> Set $wgShowExceptionDetails = true; at the bottom of LocalSettings.php to show detailed debugging information.
**What should have happened instead?**:
The preview is shown.
**Other information**:
The error seems to occur as long as the page is a valid JS and `'<script>'` or `"<script>"` ins included anywhere. Diff and saving work.
Not reproducible with [[https://en.wikipedia.org/w/index.php?title=Special:MyPage/common.js&action=edit|common.js]].