Use CodeMirror to let your Scrivito users edit HTML attributes as source code.
# Gemfile
gem 'scrivito_codemirror_editor'
// application.js
// ...
//= require scrivito
//= require scrivito_codemirror_editor
// ...
/* application.css
* ...
*= require scrivito_codemirror_editor
* ...
*/
scrivito_tag :div, :my_widget, :my_html_attribute, {}, editor: :codemirror
scrivito.on "load", ->
scrivito.select_editor (element, editing) ->
if $(element).is(".my_details_view [data-scrivito-field-type=html]")
editing.use("codemirror")
This software can be used and modified under the LGPL-3.0. Please refer to http://www.gnu.org/licenses/lgpl-3.0.html for the license text.