Skip to content

Field instructions are sanitised, erasing code #14115

@arthurperton

Description

@arthurperton

Bug description

In the instructions for a field you can use markdown. When I add a html link in the instructions, it now gets sanitised and some of the (essential) attributes are removed.

I expect the instructions to stay untouched. Is it possible to not sanitise the field instructions, because it is from a safe source?

Introduced in #14006. See the markdown function in resources/js/bootstrap/globals.js‎.

How to reproduce

Add a link to the instructions for a field and add attributes like target and onclick for example:
<a href="/some/page" target="_blank" onclick="doSomeImportantStuff();">link</a>

It will be rendered as:
<a href="/some/page">link</a>

Logs

Environment

Environment
Laravel Version: 11.48.0
PHP Version: 8.3.29
Composer Version: 2.9.3
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF
Timezone: Europe/Amsterdam
Locale: nl

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: null
Cache: file
Database: mysql
Logs: stack / single
Mail: log
Queue: sync
Session: file

Statamic
Stache Watcher: Enabled
Static Caching: Disabled
Version: 5.73.11 PRO

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions