Skip to content

Shortcode handling (map / preserve / strip) #174

Description

@tayebmokni

Summary

Implement shortcode handling per doc 08 §5.3 with three outcomes per detected shortcode: Mapped (known list: gallery, caption, embed, audio, video, playlist, wp_caption, plus opt-in plugin mappings like contact-form-7), Preserved-as-shortcode (user has a gonext plugin registered for the shortcode — wrap in core/shortcode block), or Stripped (unknown, no handler — emit empty + shortcode_unmapped warning with original text in Context). Never guess what a shortcode does.

Design reference

  • docs/08-migration-compat.md §5.3

Acceptance criteria

  • Shortcode tokenizer extracts [name attr="..." attr=...] patterns from HTML
  • Registry of known shortcodes: gallery, caption, embed, audio, video, playlist, wp_caption
  • Opt-in plugin mapping: contact-form-7, wpforms, gravityforms (when corresponding gonext plugin is installed)
  • Plugin-registered handlers wrap unknown shortcodes in core/shortcode block
  • Unknown + unhandled: stripped with shortcode_unmapped warning carrying original text in Context
  • Tests cover all three outcomes + nested shortcodes

Dependencies

#html-to-blocks

Complexity

M

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:migrationWordPress importer + compatphase:P5-migrationPhase 5 — Migrationpriority:P1Important — should land in phaseskill:goGo programmingtype:featNew feature or implementation task

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions