Class: ActionText::Editor::TrixEditor
Do not use. This class is for internal use only.
| Relationships & Source Files | |
| Namespace Children | |
|
Classes:
| |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
|
|
|
Instance Chain:
self,
::ActionText::Editor
|
|
| Inherits: |
ActionText::Editor
|
| Defined in: | actiontext/lib/action_text/editor/trix_editor.rb |
Class Method Summary
::ActionText::Editor - Inherited
::ActiveSupport::Autoload - Extended
Instance Attribute Summary
::ActionText::Editor - Inherited
Instance Method Summary
- #as_canonical(editable_fragment)
- #as_editable(canonical_fragment)
- #editor_tag
- #from_trix_attachment(node) private
- #to_trix_attachment(node) private
::ActionText::Editor - Inherited
| #as_canonical | Convert fragments served by the editor into the canonical form that Action Text stores. |
| #as_editable | Convert fragments from the canonical form that Action Text stores into a format that is supported by the editor. |
| #editor_name, #editor_tag | |
Constructor Details
This class inherits a constructor from ActionText::Editor
Instance Method Details
#as_canonical(editable_fragment)
[ GitHub ]# File 'actiontext/lib/action_text/editor/trix_editor.rb', line 5
def as_canonical(editable_fragment) editable_fragment.replace(TrixAttachment::SELECTOR, &method(:)) end
#as_editable(canonical_fragment)
[ GitHub ]# File 'actiontext/lib/action_text/editor/trix_editor.rb', line 9
def as_editable(canonical_fragment) canonical_fragment.replace(Attachment.tag_name, &method(:)) end
#editor_tag
[ GitHub ]# File 'actiontext/lib/action_text/editor/trix_editor.rb', line 13
def editor_tag(...) Tag.new(editor_name, ...) end
#from_trix_attachment(node) (private)
[ GitHub ]# File 'actiontext/lib/action_text/editor/trix_editor.rb', line 23
def (node) = TrixAttachment.new(node) Attachment.from_attributes(.attributes) end
#to_trix_attachment(node) (private)
[ GitHub ]# File 'actiontext/lib/action_text/editor/trix_editor.rb', line 18
def (node) = node.attributes TrixAttachment.from_attributes() end