Support multiple fields using the AceFormatter with different settings

Created on 13 September 2018, about 6 years ago
Updated 19 June 2024, 5 months ago

The configuration of the AceFormatter field formatter is put in the drupalSettings globally: drupalSettings.ace_formatter. This causes multiple fields using the same formatter, but with different settings not to work properly.

For instance I have two fields on a node. One setup for PHP and the other for CSS. Both fields are in the output with PHP highlighting, since the first has already added the setting "syntax: php" to the drupalSettings.

You might need to add a field-identifier to the settings object to be able to split the configuration per field and get the proper configuration for each field in the JavaScript that inits the editor.

🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇳🇱Netherlands Marty2081

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024