feat(editor): support text highlight html adapter (#9632)

[BS-2061](https://linear.app/affine-design/issue/BS-2061/html-adapter-支持-text-highlight-样式)
This commit is contained in:
donteatfriedrice
2025-01-13 02:20:58 +00:00
parent 76895e29d8
commit 5c4e87ddb5
38 changed files with 216 additions and 144 deletions
@@ -1,3 +1,4 @@
import type { ReferenceParams } from '@blocksuite/affine-model';
import { isEqual } from '@blocksuite/global/utils';
import type { DeltaInsert } from '@blocksuite/inline';
@@ -74,10 +75,22 @@ function toURLSearchParams(
);
}
function generateDocUrl(
docBaseUrl: string,
pageId: string,
params: ReferenceParams
) {
const search = toURLSearchParams(params);
const query = search?.size ? `?${search.toString()}` : '';
const url = docBaseUrl ? `${docBaseUrl}/${pageId}${query}` : '';
return url;
}
export const TextUtils = {
mergeDeltas,
isNullish,
createText,
isText,
toURLSearchParams,
generateDocUrl,
};