From b6ec8f52b1a916194382792eacee0f40e836bb6d Mon Sep 17 00:00:00 2001 From: Madeorsk Date: Sat, 31 Oct 2020 19:29:03 +0100 Subject: [PATCH] Specify className in textAttributes. This allow to pass className in textAttributes to set custom classes. --- src/trix/views/piece_view.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/trix/views/piece_view.coffee b/src/trix/views/piece_view.coffee index b5ad76018..27f1e565d 100644 --- a/src/trix/views/piece_view.coffee +++ b/src/trix/views/piece_view.coffee @@ -70,6 +70,9 @@ class Trix.PieceView extends Trix.ObjectView if config.style styles[key] = value for key, value of config.style + if config.className + pendingElement.className = config.className + if Object.keys(styles).length element ?= makeElement("span") element.style[key] = value for key, value of styles