@alvincrespo/hashnode-content-converter - v0.2.2
    Preparing search index...

    Class MarkdownTransformer

    Transforms Hashnode-specific markdown into clean, standard markdown.

    Based on analysis of 48 real Hashnode blog posts, this processor removes the align attributes that Hashnode adds to images. Optional transformations for callouts and whitespace are available but not enabled by default.

    This processor preserves valid markdown syntax including:

    • Smart quotes and em dashes
    • Emojis
    • Escaped underscores
    • HTML callout divs (unless conversion is enabled)
    • Code blocks and inline code
    const transformer = new MarkdownTransformer();
    const cleaned = transformer.transform('![](image.png) align="center"');
    // Returns: '![](image.png)'
    // With custom options
    const transformer = new MarkdownTransformer({
    removeAlignAttributes: true,
    trimTrailingWhitespace: true
    });
    const cleaned = transformer.transform('![](img.png) align="left" \n');
    // Returns: '![](img.png)\n'
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Transforms raw Hashnode markdown into cleaned markdown.

      Preserves valid markdown syntax including:

      • Smart quotes and em dashes
      • Emojis
      • Escaped underscores
      • HTML callout divs (unless conversion is enabled)
      • Code blocks and inline code

      Parameters

      • markdown: string

        Raw markdown content from Hashnode export

      Returns string

      Cleaned markdown with Hashnode-specific quirks removed

      If markdown is not a string

      const transformer = new MarkdownTransformer();

      // Remove align attributes
      transformer.transform('![](image.png) align="center"');
      // Returns: '![](image.png)'

      // Preserves valid markdown
      transformer.transform('The "Start in" field—essentially the default path');
      // Returns: 'The "Start in" field—essentially the default path'