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
@@ -132,6 +132,7 @@ export class HtmlAdapter extends BaseAdapter<Html> {
configs: this.configs,
job: this.job,
deltaConverter: this.deltaConverter,
provider: this.provider,
textBuffer: { content: '' },
assets,
updateAssetIds: (assetsId: string) => {
@@ -155,6 +156,7 @@ export class HtmlAdapter extends BaseAdapter<Html> {
configs: this.configs,
job: this.job,
deltaConverter: this.deltaConverter,
provider: this.provider,
textBuffer: { content: '' },
assets,
};
@@ -172,7 +174,10 @@ export class HtmlAdapter extends BaseAdapter<Html> {
readonly blockMatchers: BlockHtmlAdapterMatcher[];
constructor(job: Transformer, provider: ServiceProvider) {
constructor(
job: Transformer,
readonly provider: ServiceProvider
) {
super(job);
const blockMatchers = Array.from(
provider.getAll(BlockHtmlAdapterMatcherIdentifier).values()
@@ -187,7 +192,8 @@ export class HtmlAdapter extends BaseAdapter<Html> {
this.deltaConverter = new HtmlDeltaConverter(
job.adapterConfigs,
inlineDeltaToHtmlAdapterMatchers,
htmlInlineToDeltaMatchers
htmlInlineToDeltaMatchers,
provider
);
}