Skip to content

HTML Snippet doesn’t validate with HTML ‘class’ property #228

Open
@lightbulbman

Description

@lightbulbman

Current behavior

User reports:
Hi, I think I found a bug in validator.

HTML snippet with html such as

will not activate from the manage snippets table - toggle switch and shows following error:

{"success":false,"data":{"type":"action_error","message":"Could not activate snippet: code did not pass validation."}}

The snippet can be activated from the edit snippet page but not the manage snippets table

Expected behavior

The snippet should be able to be activated using the toggle in manage snippets table

Steps to reproduce

  1. Create snippet of type “HTML”
  2. insert just this:
  3. save the snippet
  4. go to the list of snippets
  5. try to activate the snippet using the UI switch
  6. should result with exclamation mark and console.log “Could not activate snippet: code did not pass validation.”
  7. Although this code can’t be activated by UI switch in the list, no problems when using [Save changes and activate] button

WordPress version

6.7.2

Code Snippets version

3.6.8

Code Snippets license

Core (free)

Anything else?

Link to original report:

https://wordpress.org/support/topic/snippet-doesnt-validate-with-html-property-class/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions