Allow <span> in TinyMCE (Wysiwyg)

I am trying to add a span to my text which by default I believe that TinyMCE does not allow.

I saw in the documentation that you can edit field types but I’m not sure where this would go.

I know I will need to use extended_valid_elements: 'span’

Can anyone ELI5 and point me in the right direction, please?

https://getcockpit.com/documentation/reference/fieldtypes

Thanks,
Dan

So, I figured this out and thought I would drop a comment to let others know how to do it if they come across the same issue.

When setting up fields (in my case it was in a singleton), select WYSIWYG and in options JSON copy the following:

{
  "editor": {
    "extended_valid_elements": "span",
    "menubar": "edit insert view format"
  }
}
1 Like