Skip to content

Allow figure/figcaption elements in HTMLEditors #12000

Description

@Iliain

Description

Current images inserted in HTML Fields, when provided with a caption, are wrapped in a <div> and the text rendered in a <p>. More accessible options are available in the form of <figure> and <figcaption> elements. The current config automatically strips these elements out, so I've submitted a config change to allow them.

These newer elements provide a semantic link to eachother, which provides additional support for screen readers and more context for SEO.

PRs

Additional context or points of discussion

This goes along with an additional change submitted to the silverstripe-htmleditor-tinymce module found here, which includes opt-in changes to allow for automatically wrapping images in the new elements.

Validations

  • You intend to implement the feature yourself
  • You have read the contributing guide
  • You strongly believe this feature should be in core, rather than being its own community module
  • You have checked for existing issues or pull requests related to this feature (and didn't find any)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions