Skip to content

Feature Request: Export formatContainerProcessor from public API #3236

@Dennis273

Description

@Dennis273

Use Case

We're building an email client and need to customize how <blockquote> elements are processed during DOM-to-Model conversion. In our application, email citations use blockquotes with zero margins:

<blockquote style="margin-top: 0; margin-bottom: 0;">...</blockquote>

We want these blockquotes to always preserve their FormatContainer semantics, but the default knownElementProcessor only triggers formatContainerProcessor when certain style values are > 0.

Request

Please export formatContainerProcessor from the public API, so users can use it in processorOverride for custom processing needs:

// In roosterjs-content-model-dom/lib/index.ts
export { formatContainerProcessor } from './domToModel/processors/formatContainerProcessor';

Current Workarounds

Without the public export, we have to use fragile workarounds:

Option 1: Require internal module path

const { formatContainerProcessor } = require(
  'roosterjs-content-model-dom/lib/domToModel/processors/formatContainerProcessor'
);

Option 2: Borrow from another tag's default processor

processorOverride: {
  blockquote: (group, element, context) => {
    context.defaultElementProcessors.pre(group, element, context);
  },
},

Rationale

  • Other processors (childProcessor, entityProcessor, tableProcessor) are already publicly exported
  • processorOverride is a public API, but users lack access to reusable processor implementations
  • Exporting formatContainerProcessor would enable legitimate customization without relying on internal paths

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions