Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

MarkdownStandaloneHashHeadingSeparatorTransform

OfficeIMO.Markdown

Namespace
OfficeIMO.Markdown
Assembly
OfficeIMO.Markdown
Source revision
0eef6a5756b9 with working tree changes
Modifiers
sealed

Removes empty standalone # separator headings that appear immediately before real headings.

Inheritance

  • object
  • MarkdownStandaloneHashHeadingSeparatorTransform

Remarks

This is intended for compatibility-oriented transcript/document cleanup where a model emitted a stray single-hash line before the actual heading content. Ordinary empty headings that are not directly followed by another heading are preserved.

Examples

var options = MarkdownLoadOptions.CreateOfficeIMOProfile();
options.DocumentTransforms.Add(new MarkdownStandaloneHashHeadingSeparatorTransform());

var document = MarkdownDocument.Parse("#\n## Result", options);

Constructors

public MarkdownStandaloneHashHeadingSeparatorTransform() #

Methods

public MarkdownDocument Transform(MarkdownDocument document, MarkdownDocumentTransformContext context) #

Applies the transform to the supplied markdown document. Implementations may mutate document in place or return a replacement instance.

Parameters

document OfficeIMO.Markdown.MarkdownDocument required
Parsed markdown document.
context OfficeIMO.Markdown.MarkdownDocumentTransformContext required
Transform execution context.

Returns

MarkdownDocument The transformed document.