Skip to content

Commit

Permalink
Remove tablePreProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
JiuqingSong committed Oct 26, 2024
1 parent 09531d8 commit b8d3dcf
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 285 deletions.
4 changes: 0 additions & 4 deletions packages/roosterjs-content-model-core/lib/editor/Editor.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { createEditorCore } from './core/createEditorCore';
import {
createEmptyModel,
tableProcessor,
ChangeSource,
cloneModel,
transformColor,
Expand Down Expand Up @@ -102,9 +101,6 @@ export class Editor implements IEditor {
case 'disconnected':
return cloneModel(
core.api.createContentModel(core, {
processorOverride: {
table: tableProcessor,
},
tryGetFromCache: false,
}),
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { createDomToModelConfig, createModelToDomConfig } from 'roosterjs-content-model-dom';
import { tablePreProcessor } from '../../override/tablePreProcessor';
import {
listItemMetadataApplier,
listLevelMetadataApplier,
Expand All @@ -21,11 +20,7 @@ import type {
export function createDomToModelSettings(
options: EditorOptions
): ContentModelSettings<DomToModelOption, DomToModelSettings> {
const builtIn: DomToModelOption = {
processorOverride: {
table: tablePreProcessor,
},
};
const builtIn: DomToModelOption = {};
const customized: DomToModelOption = options.defaultDomToModelOptions ?? {};

return {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import * as createEditorCore from '../../lib/editor/core/createEditorCore';
import * as createEmptyModel from 'roosterjs-content-model-dom/lib/modelApi/creators/createEmptyModel';
import * as domToContentModel from 'roosterjs-content-model-dom/lib/domToModel/domToContentModel';
import * as transformColor from 'roosterjs-content-model-dom/lib/domUtils/style/transformColor';
import { ChangeSource, tableProcessor } from 'roosterjs-content-model-dom';
import { Editor } from '../../lib/editor/Editor';
import { expectHtml } from 'roosterjs-content-model-dom/test/testUtils';
import { ChangeSource } from 'roosterjs-content-model-dom';
import {
CachedElementHandler,
ContentModelDocument,
Expand Down Expand Up @@ -198,9 +198,6 @@ describe('Editor', () => {

expect(model).toBe(mockedClonedModel);
expect(createContentModelSpy).toHaveBeenCalledWith(mockedCore, {
processorOverride: {
table: tableProcessor,
},
tryGetFromCache: false,
});
expect(transformColorSpy).not.toHaveBeenCalled();
Expand All @@ -212,9 +209,6 @@ describe('Editor', () => {

expect(model).toBe(mockedClonedModel);
expect(createContentModelSpy).toHaveBeenCalledWith(mockedCore, {
processorOverride: {
table: tableProcessor,
},
tryGetFromCache: false,
});
expect(transformColorSpy).toHaveBeenCalledWith(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as createDomToModelContext from 'roosterjs-content-model-dom/lib/domToModel/context/createDomToModelContext';
import * as createModelToDomContext from 'roosterjs-content-model-dom/lib/modelToDom/context/createModelToDomContext';
import { tablePreProcessor } from '../../../lib/override/tablePreProcessor';
import {
listItemMetadataApplier,
listLevelMetadataApplier,
Expand All @@ -23,22 +22,11 @@ describe('createDomToModelSettings', () => {
const settings = createDomToModelSettings({});

expect(settings).toEqual({
builtIn: {
processorOverride: {
table: tablePreProcessor,
},
},
builtIn: {},
customized: {},
calculated: mockedCalculatedConfig,
});
expect(createDomToModelContext.createDomToModelConfig).toHaveBeenCalledWith([
{
processorOverride: {
table: tablePreProcessor,
},
},
{},
]);
expect(createDomToModelContext.createDomToModelConfig).toHaveBeenCalledWith([{}, {}]);
});

it('Has options', () => {
Expand All @@ -48,20 +36,12 @@ describe('createDomToModelSettings', () => {
});

expect(settings).toEqual({
builtIn: {
processorOverride: {
table: tablePreProcessor,
},
},
builtIn: {},
customized: defaultDomToModelOptions,
calculated: mockedCalculatedConfig,
});
expect(createDomToModelContext.createDomToModelConfig).toHaveBeenCalledWith([
{
processorOverride: {
table: tablePreProcessor,
},
},
{},
defaultDomToModelOptions,
]);
});
Expand Down

This file was deleted.

0 comments on commit b8d3dcf

Please sign in to comment.