fix(core): escape special characters for cmdk item values (#5353)

![image](https://github.com/toeverything/AFFiNE/assets/102217452/301ef02e-f0df-4a1b-843f-240cad44af0f)
This commit is contained in:
JimmFly
2023-12-20 08:20:21 +00:00
parent a4f31df192
commit 9981c24120

View File

@@ -168,14 +168,15 @@ export const pageToCommand = (
// hack: when comparing, the part between >>> and <<< will be ignored // hack: when comparing, the part between >>> and <<< will be ignored
// adding this patch so that CMDK will not complain about duplicated commands // adding this patch so that CMDK will not complain about duplicated commands
const id = const id = CSS.escape(
title + title +
(label?.subTitle || '') + (label?.subTitle || '') +
valueWrapperStart + valueWrapperStart +
page.id + page.id +
'.' + '.' +
category + category +
valueWrapperEnd; valueWrapperEnd
);
return { return {
id, id,