Inline math subscript interpreted as italicisation

Steps to reproduce

Open a note in edit mode, and enable inline math:

$[your cursor here]$

Type (not copy/paste!) the following inline math equation:

$(a)_b$

Did you follow the troubleshooting guide? [Y/N]

Yes.

Expected result

Obsidian should recognise that you are typing within an inline math equation and add a single _.

Actual result

Obsidian thinks you are trying to italicise text, so places an additional _ after the cursor:

$(a)_b_$

Environment

SYSTEM INFO:
	Obsidian version: v1.4.16
	Installer version: v1.4.16
	Operating system: #202310061235~1697396945~22.04~9283e32 SMP PREEMPT_DYNAMIC Sun O 6.5.6-76060506-generic
	Login status: logged in
	Catalyst license: none
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: Minimal v7.3.5
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 7
	Plugins enabled: 7
		1: DB Folder v3.5.0
		2: Dataview v0.5.64
		3: Heading Level Indent v1.0.3
		4: Lapel v0.1.1
		5: Style Settings v1.0.7
		6: Creases v0.7.0
		7: Contextual Typography v2.2.5

RECOMMENDATIONS:
	Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
	Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Additional Information

Writing _ in inline math works as intended when following alphanumeric characters, but not when following characters such as ), ], }.