A rich text editor for everyday writing

Overview

Trix

A Rich Text Editor for Everyday Writing

Compose beautifully formatted text in your web application. Trix is a WYSIWYG editor for writing messages, comments, articles, and lists—the simple documents most web apps are made of. It features a sophisticated document model, support for embedded attachments, and outputs terse and consistent HTML.

Trix is an open-source project from Basecamp, the creators of Ruby on Rails. Millions of people trust their text to Basecamp, and we built Trix to give them the best possible editing experience. See Trix in action in the all-new Basecamp 3.

Different By Design

Most WYSIWYG editors are wrappers around HTML’s contenteditable and execCommand APIs, designed by Microsoft to support live editing of web pages in Internet Explorer 5.5, and eventually reverse-engineered and copied by other browsers.

Because these APIs were never fully specified or documented, and because WYSIWYG HTML editors are enormous in scope, each browser’s implementation has its own set of bugs and quirks, and JavaScript developers are left to resolve the inconsistencies.

Trix sidesteps these inconsistencies by treating contenteditable as an I/O device: when input makes its way to the editor, Trix converts that input into an editing operation on its internal document model, then re-renders that document back into the editor. This gives Trix complete control over what happens after every keystroke, and avoids the need to use execCommand at all.

Built for the Modern Web

Trix supports all evergreen, self-updating desktop and mobile browsers.

Trix is built with emerging web standards, notably Custom Elements, Mutation Observer, and Promises. Eventually we expect all browsers to implement these standards. In the meantime, Trix includes polyfills for missing functionality.

Getting Started

Include the bundled trix.css and trix.js files in the <head> of your page.

<head><link rel="stylesheet" type="text/css" href="trix.css">
  <script type="text/javascript" src="trix.js"></script>
</head>

trix.css includes default styles for the Trix toolbar, editor, and attachments. Skip this file if you prefer to define these styles yourself.

To use your own polyfills, or to target only browsers that support all of the required standards, include trix-core.js instead.

Creating an Editor

Place an empty <trix-editor></trix-editor> tag on the page. Trix will automatically insert a separate <trix-toolbar> before the editor.

Like an HTML <textarea>, <trix-editor> accepts autofocus and placeholder attributes. Unlike a <textarea>, <trix-editor> automatically expands vertically to fit its contents.

Integrating With Forms

To submit the contents of a <trix-editor> with a form, first define a hidden input field in the form and assign it an id. Then reference that id in the editor’s input attribute.

<form >
  <input id="x" type="hidden" name="content">
  <trix-editor input="x"></trix-editor>
</form>

Trix will automatically update the value of the hidden input field with each change to the editor.

Populating With Stored Content

To populate a <trix-editor> with stored content, include that content in the associated input element’s value attribute.

<form >
  <input id="x" value="Editor content goes here" type="hidden" name="content">
  <trix-editor input="x"></trix-editor>
</form>

Always use an associated input element to safely populate an editor. Trix won’t load any HTML content inside a <trix-editor>…</trix-editor> tag.

Styling Formatted Content

To ensure what you see when you edit is what you see when you save, use a CSS class name to scope styles for Trix formatted content. Apply this class name to your <trix-editor> element, and to a containing element when you render stored Trix content for display in your application.

<trix-editor class="trix-content"></trix-editor>
<div class="trix-content">Stored content here</div>

The default trix.css file includes styles for basic formatted content—including bulleted and numbered lists, code blocks, and block quotes—under the class name trix-content. We encourage you to use these styles as a starting point by copying them into your application’s CSS with a different class name.

Storing Attached Files

Trix automatically accepts files dragged or pasted into an editor and inserts them as attachments in the document. Each attachment is considered pending until you store it remotely and provide Trix with a permanent URL.

To store attachments, listen for the trix-attachment-add event. Upload the attached files with XMLHttpRequest yourself and set the attachment’s URL attribute upon completion. See the attachment example for detailed information.

If you don’t want to accept dropped or pasted files, call preventDefault() on the trix-file-accept event, which Trix dispatches just before the trix-attachment-add event.

Editing Text Programmatically

You can manipulate a Trix editor programmatically through the Trix.Editor interface, available on each <trix-editor> element through its editor property.

var element = document.querySelector("trix-editor")
element.editor  // is a Trix.Editor instance

Understanding the Document Model

The formatted content of a Trix editor is known as a document, and is represented as an instance of the Trix.Document class. To get the editor’s current document, use the editor.getDocument method.

element.editor.getDocument()  // is a Trix.Document instance

You can convert a document to an unformatted JavaScript string with the document.toString method.

var document = element.editor.getDocument()
document.toString()  // is a JavaScript string

Immutability and Equality

Documents are immutable values. Each change you make in an editor replaces the previous document with a new document. Capturing a snapshot of the editor’s content is as simple as keeping a reference to its document, since that document will never change over time. (This is how Trix implements undo.)

To compare two documents for equality, use the document.isEqualTo method.

var document = element.editor.getDocument()
document.isEqualTo(element.editor.getDocument())  // true

Getting and Setting the Selection

Trix documents are structured as sequences of individually addressable characters. The index of one character in a document is called a position, and a start and end position together make up a range.

To get the editor’s current selection, use the editor.getSelectedRange method, which returns a two-element array containing the start and end positions.

element.editor.getSelectedRange()  // [0, 0]

You can set the editor’s current selection by passing a range array to the editor.setSelectedRange method.

// Select the first character in the document
element.editor.setSelectedRange([0, 1])

Collapsed Selections

When the start and end positions of a range are equal, the range is said to be collapsed. In the editor, a collapsed selection appears as a blinking cursor rather than a highlighted span of text.

For convenience, the following calls to setSelectedRange are equivalent when working with collapsed selections:

element.editor.setSelectedRange(1)
element.editor.setSelectedRange([1])
element.editor.setSelectedRange([1, 1])

Directional Movement

To programmatically move the cursor or selection through the document, call the editor.moveCursorInDirection or editor.expandSelectionInDirection methods with a direction argument. The direction can be either "forward" or "backward".

// Move the cursor backward one character
element.editor.moveCursorInDirection("backward")

// Expand the end of the selection forward by one character
element.editor.expandSelectionInDirection("forward")

Converting Positions to Pixel Offsets

Sometimes you need to know the x and y coordinates of a character at a given position in the editor. For example, you might want to absolutely position a pop-up menu element below the editor’s cursor.

Call the editor.getClientRectAtPosition method with a position argument to get a DOMRect instance representing the left and top offsets, width, and height of the character at the given position.

var rect = element.editor.getClientRectAtPosition(0)
[rect.left, rect.top]  // [17, 49]

Inserting and Deleting Text

The editor interface provides methods for inserting, replacing, and deleting text at the current selection.

To insert or replace text, begin by setting the selected range, then call one of the insertion methods below. Trix will first remove any selected text, then insert the new text at the start position of the selected range.

Inserting Plain Text

To insert unformatted text into the document, call the editor.insertString method.

// Insert “Hello” at the beginning of the document
element.editor.setSelectedRange([0, 0])
element.editor.insertString("Hello")

Inserting HTML

To insert HTML into the document, call the editor.insertHTML method. Trix will first convert the HTML into its internal document model. During this conversion, any formatting that cannot be represented in a Trix document will be lost.

// Insert a bold “Hello” at the beginning of the document
element.editor.setSelectedRange([0, 0])
element.editor.insertHTML("<strong>Hello</strong>")

Inserting a File

To insert a DOM File object into the document, call the editor.insertFile method. Trix will insert a pending attachment for the file as if you had dragged and dropped it onto the editor.

// Insert the selected file from the first file input element
var file = document.querySelector("input[type=file]").file
element.editor.insertFile(file)

Inserting a Content Attachment

Content attachments are self-contained units of HTML that behave like files in the editor. They can be moved or removed, but not edited directly, and are represented by a single character position in the document model.

To insert HTML as an attachment, create a Trix.Attachment with a content attribute and call the editor.insertAttachment method. The HTML inside a content attachment is not subject to Trix’s document conversion rules and will be rendered as-is.

var attachment = new Trix.Attachment({ content: '<span class="mention">@trix</span>' })
element.editor.insertAttachment(attachment)

Inserting a Line Break

To insert a line break, call the editor.insertLineBreak method, which is functionally equivalent to pressing the return key.

// Insert “Hello\n”
element.editor.insertString("Hello")
element.editor.insertLineBreak()

Deleting Text

If the current selection is collapsed, you can simulate deleting text before or after the cursor with the editor.deleteInDirection method.

// “Backspace” the first character in the document
element.editor.setSelectedRange([1, 1])
element.editor.deleteInDirection("backward")

// Delete the second character in the document
element.editor.setSelectedRange([1, 1])
element.editor.deleteInDirection("forward")

To delete a range of text, first set the selected range, then call editor.deleteInDirection with either direction as the argument.

// Delete the first five characters
element.editor.setSelectedRange([0, 4])
element.editor.deleteInDirection("forward")

Working With Attributes and Nesting

Trix represents formatting as sets of attributes applied across ranges of a document.

By default, Trix supports the inline attributes bold, italic, href, and strike, and the block-level attributes heading1, quote, code, bullet, and number.

Applying Formatting

To apply formatting to the current selection, use the editor.activateAttribute method.

element.editor.insertString("Hello")
element.editor.setSelectedRange([0, 5])
element.editor.activateAttribute("bold")

To set the href attribute, pass a URL as the second argument to editor.activateAttribute.

element.editor.insertString("Trix")
element.editor.setSelectedRange([0, 4])
element.editor.activateAttribute("href", "https://trix-editor.org/")

Removing Formatting

Use the editor.deactivateAttribute method to remove formatting from a selection.

element.editor.setSelectedRange([2, 4])
element.editor.deactivateAttribute("bold")

Formatting With a Collapsed Selection

If you activate or deactivate attributes when the selection is collapsed, your formatting changes will apply to the text inserted by any subsequent calls to editor.insertString.

element.editor.activateAttribute("italic")
element.editor.insertString("This is italic")

Adjusting the Nesting Level

To adjust the nesting level of quotes, bulleted lists, or numbered lists, call the editor.increaseNestingLevel and editor.decreaseNestingLevel methods.

element.editor.activateAttribute("quote")
element.editor.increaseNestingLevel()
element.editor.decreaseNestingLevel()

Using Undo and Redo

Trix editors support unlimited undo and redo. Successive typing and formatting changes are consolidated together at five-second intervals; all other input changes are recorded individually in undo history.

Call the editor.undo and editor.redo methods to perform an undo or redo operation.

element.editor.undo()
element.editor.redo()

Changes you make through the editor interface will not automatically record undo entries. You can save your own undo entries by calling the editor.recordUndoEntry method with a description argument.

element.editor.recordUndoEntry("Insert Text")
element.editor.insertString("Hello")

Loading and Saving Editor State

Serialize an editor’s state with JSON.stringify and restore saved state with the editor.loadJSON method. The serialized state includes the document and current selection, but does not include undo history.

// Save editor state to local storage
localStorage["editorState"] = JSON.stringify(element.editor)

// Restore editor state from local storage
element.editor.loadJSON(JSON.parse(localStorage["editorState"]))

Observing Editor Changes

The <trix-editor> element emits several events which you can use to observe and respond to changes in editor state.

  • trix-before-initialize fires when the <trix-editor> element is attached to the DOM just before Trix installs its editor object.

  • trix-initialize fires when the <trix-editor> element is attached to the DOM and its editor object is ready for use.

  • trix-change fires whenever the editor’s contents have changed.

  • trix-selection-change fires any time the selected range changes in the editor.

  • trix-focus and trix-blur fire when the editor gains or loses focus, respectively.

  • trix-file-accept fires when a file is dropped or inserted into the editor. You can access the DOM File object through the file property on the event. Call preventDefault on the event to prevent attaching the file to the document.

  • trix-attachment-add fires after an attachment is added to the document. You can access the Trix attachment object through the attachment property on the event. If the attachment object has a file property, you should store this file remotely and set the attachment’s URL attribute. See the attachment example for detailed information.

  • trix-attachment-remove fires when an attachment is removed from the document. You can access the Trix attachment object through the attachment property on the event. You may wish to use this event to clean up remotely stored files.

Contributing to Trix

Trix is open-source software, freely distributable under the terms of an MIT-style license. The source code is hosted on GitHub.

We welcome contributions in the form of bug reports, pull requests, or thoughtful discussions in the GitHub issue tracker. Please see the Code of Conduct for our pledge to contributors.

Trix was created by Javan Makhmali and Sam Stephenson, with development sponsored by Basecamp.

Building From Source

Trix is written in CoffeeScript and compiled to JavaScript with Blade.

From inside a checkout of the Trix Git repository, issue the following commands to build the distributable files in dist/:

$ bin/setup
$ bin/blade build

Developing In-Browser

You can spawn a development web server to work on Trix in a more convenient fashion. Instead of manually rebuilding the source each time, just reload a page in your browser to see your changes.

To develop in-browser, run bin/setup and follow the displayed instructions.

Running Tests

Make sure you’re set up to build from source using the instructions above. Then run bin/blade runner and visit the displayed URL to run the Trix test suite.

Pull Requests

Only commit changes to Trix’s source (everything except the compiled files in /dist) and leave the VERSION unchanged. We update both when publishing new releases. ❤️


© 2020 Basecamp, LLC.

Comments
  • Roadmap Questions

    Roadmap Questions

    Your friendly neighborhood magnet issue for "is X coming?" and "what about Y?"

    Questions so far:

    • [ ] More font attributes? Size, face, color, underline, …
    • [ ] More block styles? Left/right/center text alignment, headings, …
    • [ ] Other writing systems? RTL and other BiDi scripts
    • [ ] Tables?
    • [ ] Attachment helpers? Upload file, take camera photo, …
    • [ ] Other editing modes? Markdown, raw HTML, …
    • [ ] Other output formats? Markdown/Textile/…
    • [ ] Integration with other frameworks? Angular/React/…
    • [ ] API for internal HTML attachments? Support @mentions with e.g. At.js, do a lo-fi task list with [ ] checkboxes, …
    • [x] Drag to reposition attachments? Rather than cut/paste only.
    • [x] Paste handlers? e.g. for automatic embedding
    • [ ] API to customize toolbar? Simpler than having to implement from scratch
    question 
    opened by jeremy 52
  • Add markdown support or state that it will not be added

    Add markdown support or state that it will not be added

    Trix doesn't support Markdown in and out, and while for many uses that's just fine, for my use-case that's a showstopper.

    I'd like to see support for Markdown (specifically CommonMark) added to Trix, either directly or perhaps as some sort of plug-in. Support for Markdown was previously raised in https://github.com/basecamp/trix/issues/35 but closed without clear resolution. Similarly, there was a "roadmap"/ideas list in https://github.com/basecamp/trix/issues/31 , but that was closed without clearly noting if that's a desired capability.

    If Markdown is expressly not going to be added to Trix (because the developers oppose it), I'd like that documented clearly. Otherwise I suspect this issue will keep resurfacing & wasting everyone's time.

    Thanks so much for your time!!

    opened by david-a-wheeler 35
  • Use p tag instead of div for regular block content

    Use p tag instead of div for regular block content

    Currently regular blocks are a <div> with newlines added as a <br> (unless you convert a line to another type and back). It would allow more flexible styling (and arguably be more semantic) to default to a <p> tag with enter adding a new tag, and shift+enter adding a <br>. This could be added as an opt-in for backwards compatibility.

    stale 
    opened by Truffula 34
  • Blob URL instead of Image URL When Dragging and Dropping An Image

    Blob URL instead of Image URL When Dragging and Dropping An Image

    Following the great instructions you provided on how to process dropped images and loading them onto a server, I got it working... sort of.

    The image uploads and looks great in trix, but when I get the content, it looks like this with the img tag pointing to a blob:

    <div><br></div><div><figure class="attachment attachment-preview jpg" data-trix-attachment="{&quot;contentType&quot;:&quot;image/jpeg&quot;,&quot;filename&quot;:&quot;MK4A7952-RT-ME-Edit.jpg&quot;,&quot;filesize&quot;:393670,&quot;height&quot;:960,&quot;href&quot;:&quot;&quot;,&quot;url&quot;:&quot;http://data.mp-app.com/cook/jimtest/MK4A7952-RT-ME-Edit_27-640x960.jpg&quot;,&quot;width&quot;:640}" data-trix-content-type="image/jpeg"><img src="blob:http://localhost/bf0371dd-5376-478b-a31c-f2c5fb300ca2" width="640" height="960"><figcaption class="caption">MK4A7952-RT-ME-Edit.jpg <span class="size">384.44 KB</span></figcaption></figure></div>

    When I load that back into trix using loadHTML and then immediately get the content, it has been transformed into what I would expect:

    <div><br></div><div><figure class="attachment attachment-preview jpg" data-trix-attachment="{&quot;contentType&quot;:&quot;image/jpeg&quot;,&quot;filename&quot;:&quot;MK4A7952-RT-ME-Edit.jpg&quot;,&quot;filesize&quot;:393670,&quot;height&quot;:960,&quot;href&quot;:&quot;&quot;,&quot;url&quot;:&quot;http://data.mp-app.com/cook/jimtest/MK4A7952-RT-ME-Edit_27-640x960.jpg&quot;,&quot;width&quot;:640}" data-trix-content-type="image/jpeg"><img src="http://data.mp-app.com/cook/jimtest/MK4A7952-RT-ME-Edit_27-640x960.jpg" width="640" height="960"><figcaption class="caption">MK4A7952-RT-ME-Edit.jpg <span class="size">384.44 KB</span></figcaption></figure></div>

    Am I missing a step when uploading images the causes the blob to revolve once the trix-add-attachment has completed?

    • Trix version: 0.9.10
    • Browser name and version: Chrome 55
    • Operating system: Mac
    opened by JimCook57 28
  • Firefox replaces space after deleting word

    Firefox replaces space after deleting word

    In Firefox, after using option+backspace (on Mac) to delete a word, and then starting to type again, Trix will replace the previous space with typed characters.

    firefox-trix-bug

    Steps to Reproduce
    1. Type a few words
    2. Hit option+backspace to delete a single word
    3. Start typing again
    4. The space that was previously before the cursor was replaced by the new characters
    Details
    • Trix version: 0.9.8
    • Browser name and version: Firefox 47.0.1
    • Operating system: OS X 10.11.5
    bug confirmed 
    opened by zachwaugh 27
  • form field doesn't clear on submit when containing an image

    form field doesn't clear on submit when containing an image

    If I put an image in the form field when I submit the form the create action in the controller completes with a successful commit and everything's in the database ok but the field doesn't clear

    <%= form_with model: @message, multipart: true, remote: true do |f| %> <%= f.rich_text_area :content, class: 'form-control' %> <%= f.hidden_field :recipients, value: @conversation_with.id %> <%= f.hidden_field :sender, value: current_user.id %> <%= f.submit 'Send' %> <% end %>

    def create @message = Message.new(message_params) respond_to do |format| if @message.save format.js ActionCable.server.broadcast 'room_channel', content: @message.content, msg_time: Time.now, recipients: @message.recipients, sender: @message.sender, sender_name: User.find(@message.sender).name end end end

    Details

    (3.6ms) COMMIT ↳ app/controllers/messages_controller.rb:29:in create' User Load (2.1ms) SELECTusers.* FROMusersWHEREusers.id= 1 LIMIT 1 ↳ app/controllers/messages_controller.rb:30:increate' ActiveStorage::Blob Load (0.8ms) SELECT active_storage_blobs.* FROM active_storage_blobs WHERE active_storage_blobs.id = 15 LIMIT 1 ↳ app/controllers/messages_controller.rb:30:in `create' Rendered active_storage/blobs/_blob.html.erb (Duration: 2.6ms | Allocations: 521) Rendered /home/fugee/.rvm/gems/ruby-2.6.5/gems/actiontext-6.0.0/app/views/action_text/content/_layout.html.erb (Duration: 18.0ms | Allocations: 3713) [ActionCable] Broadcasting to room_channel: {:content=>#<ActionText::RichText id: 92, name: "content", body: #<ActionText::Content "<div class="trix-conte...">, record_type: "Message", record_id: 332, created_at: "2020-01-23 09:07:16", updated_at: "2020-01-23 09:07:16">, :msg_time=>2020-01-23 04:07:16 -0500, :recipients=>3, :sender=>1, :sender_name=>"fugee"} RoomChannel transmitting {"content"=>{"id"=>92, "name"=>"content", "body"=>"

    <action-text-attachment sgid="BAh7CEkiCGdpZAY6BkVUSSI4Z2lkOi8vaWduYXR6bW91c2UvQWN0aXZlU3RvcmFnZTo6QmxvYi8xNT9leHBpcmVzX2luBjsAVEkiDHB1cnBvc2UGOwBUSSIPYXR0YWNoYWJsZQY7AFRJIg9leHBpcmVzX2F0BjsAVDA=--2ef70fd7ee7158e49597945edacc6988d695af54" c... (via streamed from room_channel) No template found for MessagesController#create, rendering head :no_content Completed 204 No Content in 139ms (ActiveRecord: 16.5ms | Allocations: 30044)

    • Trix version:
    • Browser name and version:
    • Operating system:
    opened by mices 26
  • NPM Module not working

    NPM Module not working

    If I try to load Trix like regular NPM modules like this:

    require('trix')
    

    I get this error:

    Uncaught ReferenceError: Trix is not defined       trix.js:20
    

    However if I try to load it in the traditional way it works:

     <script type="text/javascript" src="trix.js"></script> 
    

    But it would pain me to create this exception in my Browserify-based project. I'm loading everything else from NPM with "require".

    It seems that the trix NPM module is not ready to be "required"? Isn't the point of having things in NPM, to have the ability to load it like a regular NPM module? Looking at the code I don't see the typical initialisers usually found in NPM modules (like the UMD pattern https://github.com/umdjs/umd).

    Are there plans to enable this? Thanks.

    question 
    opened by antoniobrandao 25
  • feat: takes in and generates markdown values

    feat: takes in and generates markdown values

    Features

    • Can populate the Trix editor with a markdown string
    • Generates and syncs equivalent HTML and MD strings at all time

    This is phase 1 of markdown support

    Breaking change

    The trix-editor element now takes in (both, one of or none) html-input and md-input attributes instead of a input attribute.

    Phase 2

    Allow toggling between a Markdown and HTML editor

    Note for maintainers

    I am willing to do any modification that is requested. Different approach, more tests, etc. If adding MD support is not something that is desired, no problem. I had fun adding this feature and digging into the source code.

    Cheers!

    opened by maximedupre 22
  • Still not possible to create a new paragraph on Enter

    Still not possible to create a new paragraph on Enter

    There's been a few related issues:

    https://github.com/basecamp/trix/issues/75 https://github.com/basecamp/trix/issues/117 https://github.com/basecamp/trix/issues/123 https://github.com/basecamp/trix/issues/202

    And a few pull requests:

    https://github.com/basecamp/trix/pull/187 https://github.com/basecamp/trix/pull/240

    It's now possible to configure Trix to use a <p> tag instead of <div> with:

    Trix.config.blockAttributes.default.tagName = 'p'
    

    However, it's still not possible to configure Trix so that when I press Enter it creates a new paragraph instead of inserting a <br> tag. I'm aware of the issue with the <figure> tag which can't be put inside a paragraph and stay a valid HTML, however I'm not using images (and if I was I would just do it without using the <figure> tag). I don't say that creating a new paragraph on Enter should be the default but there should at least be an option. For example, the breakOnReturn option like proposed in pull request 187.

    iTunes only supports the following tags: <p>, <ol>, <ul>, <li> and <a>. No other tag is supported, and this includes the <br> tag as far as I know. It would be really great if someone could have a fresh new look at that issue. Especially as it has been asked by numerous people already, and code was provided multiple times but no solution ever gets merged.

    stale 
    opened by JosephHalter 22
  • What is the best way to extend the toolbar?

    What is the best way to extend the toolbar?

    Hi,

    I am trying to extend the functionality of the default toolbar by adding additional buttons, with and without dialogs (similar to the link dialog).

    I have seen #28, however it does not address adding specific customised functionality, nor is it documented elsewhere.

    What is the best approach to do this? Does Trix expose any settings to easily do this?

    Thanks.

    question 
    opened by ablamunits 22
  • several buttons not working?

    several buttons not working?

    Editor doesnt seem to be completing several actions when using a few buttons work but others do nothing at all

    Steps to Reproduce
    1. clicking several buttons wont work
    2. Bullet point, speech marks
    Details
    • Trix version: latest
    • Browser name and version: Chrome latest Version 75.0.3770.100
    • Operating system: mac
    Screen Shot 2019-07-10 at 14 44 36

    also whenever you click on editor this error appears for any action on editor

    custom-elements-es5-adapter.js:13 Uncaught TypeError: Illegal constructor at new HTMLElement (custom-elements-es5-adapter.js:13) at new n (app.js:22) at text/html (app.js:23) at Object.serializeToContentType (app.js:23) at a.updateInputElement (app.js:28) at a.notifyEditorElement (app.js:28) at a.notifyEditorElement (app.js:28) at a.compositionControllerDidRender (app.js:28) at c.render (app.js:25) at a.render (app.js:28)

    stale 
    opened by iiCe89 21
  • SoureMappingURL points to minified source map that does not exist on Trix 2.0.4

    SoureMappingURL points to minified source map that does not exist on Trix 2.0.4

    on 2.0.4, when I run yarn build, I get the following DEBUG message ● [DEBUG] Failed to read file "node_modules/trix/dist/trix.esm.min.js.map": open .../node_modules/trix/dist/trix.esm.min.js.map: no such file or directory

    When I look in the trix folder in node_modules

    I see

    node_modules/trix/dist/trix.esm.js but not node_modules/trix/dist/trix.esm.min.js

    I'm not sure if this is a build and release config issue, or something on my install end. Anyone have any ideas?

    opened by maxwell 0
  • Cursor stuck around attachment when pressing up arrow

    Cursor stuck around attachment when pressing up arrow

    The cursor is unable to get to the line above and keeps jumping around the attachment.

    Steps to Reproduce
    1. Open https://trix-editor.org/.
    2. Delete all the default text.
    3. Press enter.
    4. Press a.
    5. Insert a PDF (or anything else that doesn't show a thumbnail) attachment.
    6. Press up arrow repeatedly.

    Snímek obrazovky 2022-12-22 v 10 35 27

    Details
    • Trix version: 2.0.4
    • Browser name and version:
      • Brave (Verze 1.46.144 Chromium: 108.0.5359.128 (Oficiální sestavení) (arm64))
      • Chrome (Verze 106.0.5249.61 (Oficiální sestavení) (arm64))
      • Edge (Verze 106.0.1370.52 (Oficiální build) (arm64))
      • Safari (Verze 16.1 (18614.2.9.1.12))
    • Operating system: macOS 13.0.1

    It worked fine in Firefox (108.0.1 (64-bit)).

    opened by Thomaash 0
  • Heading and list can be enabled at the same time

    Heading and list can be enabled at the same time

    Its possible to make a list item a title, but it's not possible to remove the list styling as soon as its a item. Does it make sense that list items can be styled as title?

    Steps to Reproduce
    1. Go to https://trix-editor.org
    2. Focus the first paragraph of text
    3. Make it a unordered/ordered list
    4. Click on the T element
    Details
    • Trix version: 2.0.3
    • Browser name and version: Safari 16.1
    • Operating system: macOS 13
    opened by philipgiuliani 0
  • Cannot set HTML class attribute on block element

    Cannot set HTML class attribute on block element

    It looks like support for html class attributes should work on block elements here by passing a className option.

      if (options.className) {
        options.className.split(" ").forEach((className) => {
          element.classList.add(className)
        })
      }
    

    However I cannot get the editor to add a class to the element:

    Trix.config.blockAttributes.h2 = {
        tagName: 'h2',
        className: 'test1'
    }
    
    addEventListener("trix-initialize", function(event) {  
      var buttonHTML = '<button type="button" data-trix-attribute="h2">H2</button>'
      event.target.toolbarElement
          .querySelector(".button_group.text_tools")
          .insertAdjacentHTML("beforeend", buttonHTML)
    })
    
    Steps to Reproduce
    1. Go to JS fiddle: https://jsfiddle.net/mzsjpn8e/8/
    2. enter text into the editor
    3. highlight the text
    4. click the h2 button
    5. inspect the source code to see that the h2 element was create but that there is no class attribute
    <trix-editor input="x" contenteditable="" trix-id="1" toolbar="trix-toolbar-1">
        <h2><!--block-->test</h2>
    </trix-editor>
    

    I am using actionText in rails. I see that the class attribute should already be allowed:

    3.1.3 :001 > ActionText::ContentHelper.allowed_attributes
     => 
    #<Set:                                                    
     {"href",
      "src",
      "width",
      "height",
      "alt",
      "cite",
      "datetime",
      "title",
      "class",
      "name",
      "xml:lang",
      "abbr",
      "sgid",
      "content-type",
      "url",
      "filename",
      "filesize",
      "previewable",
      "presentation",
      "caption"}> 
    
    opened by spyderman4g63 0
  • Does Trix plan to support `HTMLElement.attachInternals`?

    Does Trix plan to support `HTMLElement.attachInternals`?

    Integrating with HTMLElement.attachInternals could enable <trix-editor> elements to write their contents directly to <form> and FormData instances, without the need to write to a related <input type="hidden"> element.

    Furthermore, they could set their validity state with attribute validations like [required], add support for CSS pseudo-classes like :invalid and :disabled, access their assigned <form> element from callbacks.

    There are fairly straightforward paths toward changing the Trix codebase to rely on mechanisms built-into ElementInternals, and some clear wins to be had.

    Unfortunately (!), there isn't global support just yet, with Safari as the main hold-out. According to the WebKit Bug Tracker, there have been recent changes aimed at implementing ElementInternals.

    Has there been any discussion about migrating toward using these tools? Would it be possible to start a migration with feature detection checks for partial support, or would it be best to wait until all browser support has landed before getting started?

    opened by seanpdoyle 1
  • trix.css missing in bower installation

    trix.css missing in bower installation

    Describe the bug or issue here… Using bower install with angular-trix leads to failure because of dependency on trix.css. bower_components does not include trix/dist/trix.css. I am not sure if it was removed recently.

    Related Stackoverflow Issue: https://stackoverflow.com/questions/74487591/how-to-add-trix-css-when-it-is-removed-after-pruning

    I believe this is because of the version update, as the latest version does not contain the dist/trix.css. Can you please help me with the correct replacement for it?

    Thanks!

    Steps to Reproduce
    1. Create a bower.json with angular-trix included in the packages.
    2. Run bower install --allow-root.
    3. See that the bower_components/trix does not include a dist directory at all.
    Details
    • Trix version:
    • Browser name and version:
    • Operating system:
    opened by gchhablani 0
Releases(v2.0.4)
  • v2.0.4(Dec 21, 2022)

    What's Changed

    • rebrand from Basecamp back to 37signals by @northeastprince in https://github.com/basecamp/trix/pull/1029
    • Extend Samsung keyboard buggy mode detection by @afcapel in https://github.com/basecamp/trix/pull/1030
    • Bump decode-uri-component from 0.2.0 to 0.2.2 by @dependabot in https://github.com/basecamp/trix/pull/1026
    • Fixed mistake with readme section for Loading and Saving Editor State. by @edmundmunday in https://github.com/basecamp/trix/pull/981
    • Replace deprecated media feature by @tysongach in https://github.com/basecamp/trix/pull/957

    New Contributors

    • @northeastprince made their first contribution in https://github.com/basecamp/trix/pull/1029
    • @edmundmunday made their first contribution in https://github.com/basecamp/trix/pull/981
    • @tysongach made their first contribution in https://github.com/basecamp/trix/pull/957

    Full Changelog: https://github.com/basecamp/trix/compare/v2.0.3...v2.0.4

    Source code(tar.gz)
    Source code(zip)
  • v2.0.3(Dec 5, 2022)

    What's Changed

    • Changes Attachment example as per 2.x version by @BilalBudhani in https://github.com/basecamp/trix/pull/1024
    • Expose models directly under the Trix constant by @afcapel in https://github.com/basecamp/trix/pull/1025
    • Run test suite on Android 12 by @afcapel in https://github.com/basecamp/trix/pull/1016

    New Contributors

    • @BilalBudhani made their first contribution in https://github.com/basecamp/trix/pull/1024

    Full Changelog: https://github.com/basecamp/trix/compare/v2.0.2...v2.0.3

    Source code(tar.gz)
    Source code(zip)
  • v2.0.2(Nov 30, 2022)

    What's Changed

    • Better Samsung keyboard for Android detection by @afcapel in https://github.com/basecamp/trix/pull/1021

    Full Changelog: https://github.com/basecamp/trix/compare/v2.0.1...v2.0.2

    Source code(tar.gz)
    Source code(zip)
  • v2.0.1(Nov 23, 2022)

    What's Changed

    • Update style to version 2 in README by @olimart in https://github.com/basecamp/trix/pull/1012
    • Bump engine.io from 6.2.0 to 6.2.1 by @dependabot in https://github.com/basecamp/trix/pull/1019
    • Bump terser from 5.12.1 to 5.15.1 by @dependabot in https://github.com/basecamp/trix/pull/1009
    • Guard against Samsung keyboard triggering a re-render when the cursor moves by @afcapel in https://github.com/basecamp/trix/pull/1018

    New Contributors

    • @olimart made their first contribution in https://github.com/basecamp/trix/pull/1012

    Full Changelog: https://github.com/basecamp/trix/compare/v2.0.0...v2.0.1

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Nov 7, 2022)

    What's Changed

    • Add TrixEditorElement.form property by @seanpdoyle in https://github.com/basecamp/trix/pull/899
    • Migrate build system to rollup by @afcapel in https://github.com/basecamp/trix/pull/927
    • Remove extra @charset "UTF-8" in compiled CSS by @t27duck in https://github.com/basecamp/trix/pull/897
    • Add trix-paste event to readme by @ayushn21 in https://github.com/basecamp/trix/pull/790
    • Update development dependencies by @afcapel in https://github.com/basecamp/trix/pull/926
    • Add support for multi-line placeholder text by @terreng in https://github.com/basecamp/trix/pull/910
    • Remove some properties from Trix global by @afcapel in https://github.com/basecamp/trix/pull/928
    • Remove Trix.TestHelpers global by @afcapel in https://github.com/basecamp/trix/pull/929
    • Remove remaining properties of the window.Trix global by @afcapel in https://github.com/basecamp/trix/pull/930
    • Decaffeinate unit tests by @afcapel in https://github.com/basecamp/trix/pull/931
    • Decaffeinate remaining test files by @afcapel in https://github.com/basecamp/trix/pull/944
    • Decaffeinate remaining coffeescript by @afcapel in https://github.com/basecamp/trix/pull/945
    • Add ESM and minified ESM targets to build by @afcapel in https://github.com/basecamp/trix/pull/949
    • New icons by @afcapel in https://github.com/basecamp/trix/pull/965
    • Fix ensureAttachmentExclusivelyHasAttribute by @afcapel in https://github.com/basecamp/trix/pull/967
    • Fix typo in importing Document model (v2) by @ikanade in https://github.com/basecamp/trix/pull/959
    • Configure Sauce Connect Proxy to work with Github actions by @afcapel in https://github.com/basecamp/trix/pull/989
    • Don't start Trix automatically on load by @afcapel in https://github.com/basecamp/trix/pull/988
    • Add a yarn start for easier local development by @kevinmcconnell in https://github.com/basecamp/trix/pull/992
    • Replace callbacks with async/await in tests by @afcapel in https://github.com/basecamp/trix/pull/994
    • Qunit upgrade by @afcapel in https://github.com/basecamp/trix/pull/995
    • Ignore multiple start() calls by @kevinmcconnell in https://github.com/basecamp/trix/pull/1004
    • Run yarn build-assets at the beginning of yarn start by @shimbaco in https://github.com/basecamp/trix/pull/1006
    • Fix a link on README by @shimbaco in https://github.com/basecamp/trix/pull/1005
    • Allow intercepting attachment toolbar creation by @kevinmcconnell in https://github.com/basecamp/trix/pull/1007
    • Show output on the development page by @kevinmcconnell in https://github.com/basecamp/trix/pull/1002
    • Allow customizing the table separator by @kevinmcconnell in https://github.com/basecamp/trix/pull/1003
    • Automatically start Trix on the next tick after import by @afcapel in https://github.com/basecamp/trix/pull/1008
    • Idempotent Custom Element registration by @seanpdoyle in https://github.com/basecamp/trix/pull/983

    New Contributors

    • @t27duck made their first contribution in https://github.com/basecamp/trix/pull/897
    • @ayushn21 made their first contribution in https://github.com/basecamp/trix/pull/790
    • @terreng made their first contribution in https://github.com/basecamp/trix/pull/910
    • @ikanade made their first contribution in https://github.com/basecamp/trix/pull/959
    • @kevinmcconnell made their first contribution in https://github.com/basecamp/trix/pull/992
    • @shimbaco made their first contribution in https://github.com/basecamp/trix/pull/1006

    Full Changelog: https://github.com/basecamp/trix/compare/1.3.1...v2.0.0

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-beta.1(Nov 3, 2022)

    What's Changed

    • Fix ensureAttachmentExclusivelyHasAttribute by @afcapel in https://github.com/basecamp/trix/pull/967
    • Fix typo in importing Document model (v2) by @ikanade in https://github.com/basecamp/trix/pull/959
    • Configure Sauce Connect Proxy to work with Github actions by @afcapel in https://github.com/basecamp/trix/pull/989
    • Don't start Trix automatically on load by @afcapel in https://github.com/basecamp/trix/pull/988
    • Add a yarn start for easier local development by @kevinmcconnell in https://github.com/basecamp/trix/pull/992
    • Replace callbacks with async/await in tests by @afcapel in https://github.com/basecamp/trix/pull/994
    • Qunit upgrade by @afcapel in https://github.com/basecamp/trix/pull/995
    • Ignore multiple start() calls by @kevinmcconnell in https://github.com/basecamp/trix/pull/1004
    • Run yarn build-assets at the beginning of yarn start by @shimbaco in https://github.com/basecamp/trix/pull/1006
    • Fix a link on README by @shimbaco in https://github.com/basecamp/trix/pull/1005
    • Allow intercepting attachment toolbar creation by @kevinmcconnell in https://github.com/basecamp/trix/pull/1007
    • Show output on the development page by @kevinmcconnell in https://github.com/basecamp/trix/pull/1002
    • Allow customizing the table separator by @kevinmcconnell in https://github.com/basecamp/trix/pull/1003
    • Automatically start Trix on the next tick after import by @afcapel in https://github.com/basecamp/trix/pull/1008

    New Contributors

    • @ikanade made their first contribution in https://github.com/basecamp/trix/pull/959
    • @kevinmcconnell made their first contribution in https://github.com/basecamp/trix/pull/992
    • @shimbaco made their first contribution in https://github.com/basecamp/trix/pull/1006

    Full Changelog: https://github.com/basecamp/trix/compare/v2.0.0-beta.0...v2.0.0-beta.1

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-beta.0(Mar 29, 2022)

    What's Changed

    • New icons by @afcapel in https://github.com/basecamp/trix/pull/965

    Full Changelog: https://github.com/basecamp/trix/compare/v2.0.0-alpha.1...v2.0.0-beta.0

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-alpha.1(Feb 17, 2022)

    What's Changed

    • Fixed Trix.HTMLSanitizer and Trix.HTMLParser definitions.

    Full Changelog: https://github.com/basecamp/trix/compare/v2.0.0-alpha.0...v2.0.0-alpha.1

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0-alpha.0(Jan 18, 2022)

    What's Changed

    This is the first alpha release of v2, translated from the original coffeescript source to modern JavaScript.

    New Contributors

    • @afcapel made their first contribution in https://github.com/basecamp/trix/pull/927
    • @t27duck made their first contribution in https://github.com/basecamp/trix/pull/897
    • @ayushn21 made their first contribution in https://github.com/basecamp/trix/pull/790
    • @terreng made their first contribution in https://github.com/basecamp/trix/pull/910

    Full Changelog: https://github.com/basecamp/trix/compare/1.3.1...v2.0.0-alpha.0

    Source code(tar.gz)
    Source code(zip)
  • 1.3.1(Dec 4, 2020)

    • SECURITY: Fix sanitizing pasted <iframe>s (https://github.com/basecamp/trix/commit/f81b606cd01851f23f4c31c62c16d3e78c911480, https://github.com/basecamp/trix/commit/29c4994505bb676e27cd431f8b2c6cfc27431d00)
    • SECURITY: Fix sanitizing malformed attachment markup (https://github.com/basecamp/trix/commit/9601ac9bc1fb6137d86826e2a0683a599f88638b)
    • CHANGE: Improve associated <label> accessibility (https://github.com/basecamp/trix/pull/843)
    • FIX: Dropping files on existing attachments (https://github.com/basecamp/trix/pull/834)
    • FIX: Focusing after successive placeholder clicks (https://github.com/basecamp/trix/issues/859, https://github.com/basecamp/trix/commit/1e8b295f31eb4bb5a0e727aa919d07bef6a7119a)
    Source code(tar.gz)
    Source code(zip)
    trix-core.js(205.22 KB)
    trix.css(15.66 KB)
    trix.js(224.53 KB)
  • 1.3.0(Sep 24, 2020)

  • 1.2.4(Aug 4, 2020)

  • 1.2.3(Mar 9, 2020)

    • CHANGE: Sanitize javascript: protocol in href attributes (https://github.com/basecamp/trix/commit/5bd3c13c8d5fcfd1f1fb06608199c9cd50cb6623, https://github.com/basecamp/trix/pull/712)
    • CHANGE: Improve toolbar button styling on narrow viewports (https://github.com/basecamp/trix/pull/727)
    • FIX: Resetting toolbar state when selecting attachments (https://github.com/basecamp/trix/pull/732, https://github.com/basecamp/trix/issues/554)
    • FIX: Parsing bare text nodes preceded by block elements (https://github.com/basecamp/trix/pull/742, https://github.com/basecamp/trix/issues/707)
    Source code(tar.gz)
    Source code(zip)
    trix-core.js(201.76 KB)
    trix.css(15.62 KB)
    trix.js(221.08 KB)
  • 1.2.2(Dec 2, 2019)

  • 1.2.1(Oct 17, 2019)

    • FIX: Rendering identical blocks after re-parsing HTML (https://github.com/basecamp/trix/issues/662, https://github.com/basecamp/trix/commit/692e2fdda87300a6f760abc3a755b0ac26bc72d6)
    • FIX: Parsing text nodes following block elements (https://github.com/basecamp/trix/issues/663, https://github.com/basecamp/trix/commit/d4edd234954e6a57fc2c7cb7f02b0e2f83b6445f)
    • FIX: Parsing nested block elements at different nesting levels (https://github.com/basecamp/trix/issues/352, https://github.com/basecamp/trix/commit/286cf2470d30953554ab4b67cc1e4af33eded25c ⇢ https://github.com/basecamp/trix/commit/664d9d9b4b1bd058abe3ac3b039880182922eb2e)
    • FIX: Persisting original <img> dimensions when loading HTML (https://github.com/basecamp/trix/issues/668, https://github.com/basecamp/trix/commit/be7fca764f1af090cf8e1e18c4d7ba8bdc2a6014)
    • FIX: Compatibility with Custom Elements v1 polyfill in IE 11 (https://github.com/basecamp/trix/issues/669, https://github.com/basecamp/trix/commit/641112d92689587508dc4c996dac4a441826f83d)
    Source code(tar.gz)
    Source code(zip)
    trix-core.js(201.06 KB)
    trix.css(15.60 KB)
    trix.js(220.38 KB)
  • 1.2.0(Jul 29, 2019)

    • NEW: Toolbar button for attaching files (https://github.com/basecamp/trix/pull/619)
    • FIX: Recording undo history when applying block formatting to a collapsed selection (https://github.com/basecamp/trix/pull/629, https://github.com/basecamp/trix/issues/628)
    Source code(tar.gz)
    Source code(zip)
  • 1.1.1(Apr 17, 2019)

    • FIX: Deleting the last character in a composed word on Android (https://github.com/basecamp/trix/commit/d9143c0d607da9bfb743dc8acfdbaeef558f61fb)
    • FIX: Cursor jumping when deleting into a space at the end of a block in IE 11 (https://github.com/basecamp/trix/pull/615)
    • FIX: Handling link pastes in Safari (https://github.com/basecamp/trix/commit/4fff711a76bab3ed658549170c4e2c9491f60d30)
    • FIX: Detecting InputEvent support in Firefox 67ᵇᵉᵗᵃ (https://github.com/basecamp/trix/commit/5efabb52dc5f93cc34db65d9a789a92e47762fcb)
    Source code(tar.gz)
    Source code(zip)
    trix-core.js(199.65 KB)
    trix.css(15.14 KB)
    trix.js(218.97 KB)
  • 1.1.0(Mar 4, 2019)

  • 1.0.0(Sep 26, 2018)

    • NEW: Image galleries (https://github.com/basecamp/trix/pull/523)
    • NEW: Support for canceling input events (https://github.com/basecamp/trix/pull/532)
    • NEW: Content attachment API (https://github.com/basecamp/trix/commit/756dcb576bcc2330f8bc66dfbf90bf25675c4d95)
    • NEW: trix-before-initialize event (https://github.com/basecamp/trix/commit/bee19f54c461f0b4c818da3a7fcd83217a916bcf)
    • CHANGE: Left-align <trix-toolbar> formatting button groups (https://github.com/basecamp/trix/commit/6bfb41c8590272f374b95d10578583ed1790a527)
    • CHANGE: Only dispatch trix-initialize event on first connect (https://github.com/basecamp/trix/commit/5032fd1dc1271432ab48af4f5e05fe96dc999438)
    • CHANGE: Remove deprecated indention level editor methods (https://github.com/basecamp/trix/commit/211eba8674b057a6f046d8ef5180f3a227bd5377)
    • CHANGE: Improve trix.css styles for hiding attachment selections (https://github.com/basecamp/trix/commit/4a1a6aaa42fea5da6fe5389ad2390d55cd81ff3d)
    • FIX: Prevent some keyboard commands from inserting text (https://github.com/basecamp/trix/pull/534, https://github.com/basecamp/trix/commit/8d5294a336170930fe94508834fc73f187eb0af2)
    Source code(tar.gz)
    Source code(zip)
    trix-core.js(184.07 KB)
    trix.css(15.14 KB)
    trix.js(203.38 KB)
  • 0.12.1(Sep 12, 2018)

  • 0.12.0(Jul 26, 2018)

  • 0.11.4(Jul 2, 2018)

  • 0.11.3(Jun 6, 2018)

    • Fix that pressing esc in Safari would insert a literal \u001b escape character (https://github.com/basecamp/trix/issues/506)
    • Fix that block attributes could be added as text attributes when inserting attachments (https://github.com/basecamp/trix/commit/10657b439ca4c9b19ebfeb97d1edc9c164749bc7)
    • Improve JAWS and NVDA screen reader accessibility (https://github.com/basecamp/trix/pull/492, https://github.com/basecamp/trix/issues/195)
    • Improve placeholder styling on Linux (https://github.com/basecamp/trix/pull/502)
    Source code(tar.gz)
    Source code(zip)
    trix-core.js(180.17 KB)
    trix.css(12.89 KB)
    trix.js(199.34 KB)
  • 0.11.2(Mar 2, 2018)

  • 0.11.1(Oct 5, 2017)

    • Fix occasional multibyte character (emoji, basically) breakage on iOS (https://github.com/basecamp/trix/pull/439)
    • Fix cursor position when pasting HTML in an expanded selection (https://github.com/basecamp/trix/commit/3a3f1896ab1bfa16e81cc2fefd582f5d5a285c8d)
    • Fix accessibility issue where pressing tab would incorrectly move focus to a linked attachment instead of the next form element (https://github.com/basecamp/trix/commit/3a3f1896ab1bfa16e81cc2fefd582f5d5a285c8d)
    • Fix editing upload-in-progress attachment captions (https://github.com/basecamp/trix/pull/445)
    • Fix pasting in MS Edge (https://github.com/basecamp/trix/issues/452)
    • Improve displaying code blocks in list items (https://github.com/basecamp/trix/pull/450)
    Source code(tar.gz)
    Source code(zip)
    trix-core.js(179.53 KB)
    trix.css(12.91 KB)
    trix.js(198.70 KB)
  • 0.11.0(Aug 15, 2017)

    • Add support for configuring attachment captions (https://github.com/basecamp/trix/pull/434)
    • Update attachment and toolbar CSS and related configuration (https://github.com/basecamp/trix/pull/435)
    • Improve pastes from Microsoft Word (8bc9ee2a2f9b896426ef29ed4875f2f413c1328c, b5d1bddbba9a0e819e8e3e64b08150b903234de8)
    • Improve URL pastes in Safari (19bc507c17f2d9070cd5193d843dc1b3ebd36fba)
    Source code(tar.gz)
    Source code(zip)
    trix-core.js(177.83 KB)
    trix.css(12.70 KB)
    trix.js(197.00 KB)
  • 0.10.2(Jul 6, 2017)

    • Fix error when dragging content in IE 11 (https://github.com/basecamp/trix/issues/383)
    • Fix render timing when updating attachment attributes (https://github.com/basecamp/trix/issues/388)
    • Fix extra newline in code blocks in Firefox (https://github.com/basecamp/trix/issues/408)
    • Fix incorrect document transformations caused by CRLFs (https://github.com/basecamp/trix/issues/398)
    • Fix cursor appearance around attachments (https://github.com/basecamp/trix/pull/412)
    • Fix that copying a collapsed selection would clear the clipboard (https://github.com/basecamp/trix/issues/425)
    • Fix Paste and Match Style in Safari (https://github.com/basecamp/trix/pull/426)
    • Remove toolbar buttons from navigation flow (https://github.com/basecamp/trix/pull/369)
    • Improve editing attachment captions (https://github.com/basecamp/trix/pull/409)
    • Improve <trix-editor> Shadow DOM support (https://github.com/basecamp/trix/issues/385)
    Source code(tar.gz)
    Source code(zip)
    trix-core.js(175.96 KB)
    trix.css(15.56 KB)
    trix.js(195.13 KB)
  • 0.10.1(Jan 27, 2017)

    • Improve handling of URL pastes in Safari (6754f6c6ffecdf0dc7b6cb0e908caf9be56a6978, https://github.com/basecamp/trix/issues/340)
    • Improve performance when inserting multiple files (https://github.com/basecamp/trix/pull/355)
    • Fix that editor.attributeIsActive returned true for disabled attributes (d0aa940c0b372974009625443f7d90230af14123, https://github.com/basecamp/trix/issues/356)
    • Fix that document edits in a trix-attachment-add event handler would dispatch a second trix-attachment-add (90c1c02e0d79341554efffc18bea0a2806de084b, https://github.com/basecamp/trix/issues/363)
    • Avoid contenteditable bug in Firefox that could result in duplicated <trix-editor>s (44b4023bddbf89aa2d979f06da1ec64fb4cb9129, https://github.com/basecamp/trix/issues/360)
    Source code(tar.gz)
    Source code(zip)
    trix-core.js(174.36 KB)
    trix.css(15.39 KB)
    trix.js(193.53 KB)
  • 0.10.0(Nov 30, 2016)

    • All new trix.css styles. The included toolbar styles are now responsive and mobile friendly. (https://github.com/basecamp/trix/pull/268)
    • Fix parsing block elements for <trix-editor>s in <td>s (https://github.com/basecamp/trix/commit/907ae00468423f106b35c4fadae7d99f02462957)
    • Fix serializing HTML after previewable attachments preload (https://github.com/basecamp/trix/commit/35e5834b5aaa0a8f2e9c44c7d103eca1d6c2a542)
    Source code(tar.gz)
    Source code(zip)
    trix-core.js(174.70 KB)
    trix.css(15.39 KB)
    trix.js(193.87 KB)
  • 0.9.10(Nov 18, 2016)

    • Fix error when using the Editor API on an unfocused <trix-editor> (90991520a2958dde70e17b46d05f20f044359c97)
    • Fix setting selection after a nested block element (https://github.com/basecamp/trix/pull/312)
    • Fix setting selection after pressing return in an attachment caption (https://github.com/basecamp/trix/commit/433b63d7f61c835ec34984775b4675133d96c09b)
    • Fix HTML parsing edge cases in Safari and MS* (https://github.com/basecamp/trix/commit/be75a2d6477a1969cf6e9f402d774aa3fdc75fa2, https://github.com/basecamp/trix/commit/778f4d8f84ac4278bf7b644fd73e1125c8b4e6c4)
    • Fix serializing HTML after composition events (https://github.com/basecamp/trix/pull/325)
    • Fix deleting formatted words with option+backspace (https://github.com/basecamp/trix/pull/339)
    • Fix inserting newlines in list items with shift+return in Safari (https://github.com/basecamp/trix/commit/5b6572783d00d7336518aeca8eb33f514a15556c)
    • Fix applying code formatting to multiline selections (https://github.com/basecamp/trix/commit/46f18c7d3c96ca9df478c1ea17f685277516dda7)
    • Fix occasional console warning after inserting image attachments (https://github.com/basecamp/trix/pull/341, https://github.com/basecamp/trix/commit/4a592e843d20022c0252318b4b0549a2d80a70eb)
    • Ensure trix-change event fires and HTML is serialized when toggling attributes (https://github.com/basecamp/trix/pull/317)
    • Ensure trix-focus and trix-blur events are dispatched in the correct order (https://github.com/basecamp/trix/commit/3a9eb43552405e717ae799fdb185a23fb186b778)
    • Improve composition event handling on older Android versions (https://github.com/basecamp/trix/pull/323)
    Source code(tar.gz)
    Source code(zip)
    trix-core.js(174.21 KB)
    trix.css(11.02 KB)
    trix.js(193.37 KB)
Owner
Basecamp
HEY! It's in Basecamp!
Basecamp
Simple rich text editor (contentEditable) for jQuery UI

Hallo - contentEditable for jQuery UI Hallo is a very simple in-place rich text editor for web pages. It uses jQuery UI and the HTML5 contentEditable

Henri Bergius 2.4k Dec 17, 2022
A modern, simple and elegant WYSIWYG rich text editor.

jQuery-Notebook A simple, clean and elegant WYSIWYG rich text editor for web aplications Note: Check out the fully functional demo and examples here.

Raphael Cruzeiro 1.7k Dec 12, 2022
Medium.com WYSIWYG editor clone. Uses contenteditable API to implement a rich text solution.

If you would be interested in helping to maintain one of the most successful WYSIWYG text editors on github, let us know! (See issue #1503) MediumEdit

yabwe 15.7k Jan 4, 2023
Tiny bootstrap-compatible WISWYG rich text editor

bootstrap-wysiwyg Important information for Github requests/issues Please do not submit issues/comments to this repo. Instead, submit it to https://gi

MindMup 5.6k Jan 3, 2023
HTML5 rich text editor. Try the demo integration at

Squire Squire is an HTML5 rich text editor, which provides powerful cross-browser normalisation in a flexible lightweight package (only 16.5KB of JS a

Neil Jenkins 4.4k Dec 28, 2022
Open source rich text editor based on HTML5 and the progressive-enhancement approach. Uses a sophisticated security concept and aims to generate fully valid HTML5 markup by preventing unmaintainable tag soups and inline styles.

This project isn’t maintained anymore Please check out this fork. wysihtml5 0.3.0 wysihtml5 is an open source rich text editor based on HTML5 technolo

Christopher Blum 6.5k Jan 7, 2023
Popline is an HTML5 Rich-Text-Editor Toolbar

popline Popline is a non-intrusive WYSIWYG editor that shows up only after selecting a piece of text on the page, inspired by popclip. Usage Load jQue

kenshin 1k Nov 4, 2022
Open source rich text editor based on HTML5 and the progressive-enhancement approach. Uses a sophisticated security concept and aims to generate fully valid HTML5 markup by preventing unmaintainable tag soups and inline styles.

This project isn’t maintained anymore Please check out this fork. wysihtml5 0.3.0 wysihtml5 is an open source rich text editor based on HTML5 technolo

Christopher Blum 6.5k Dec 30, 2022
A powerful WYSIWYG rich text web editor by pure javascript

KothingEditor A powerful WYSIWYG rich text web editor by pure javascript Demo : kothing.github.io/editor The KothingEditor is a lightweight, flexible,

Kothing 34 Dec 25, 2022
The world's #1 JavaScript library for rich text editing. Available for React, Vue and Angular

TinyMCE TinyMCE is the world's most advanced open source core rich text editor. Trusted by millions of developers, and used by some of the world's lar

Tiny 12.4k Jan 4, 2023
A completely customizable framework for building rich text editors. (Currently in beta.)

A completely customizable framework for building rich text editors. Why? · Principles · Demo · Examples · Documentation · Contributing! Slate lets you

Ian Storm Taylor 26.2k Dec 30, 2022
Collection of tools for building rich text editors.

psst we have great documentation at https://bangle.dev What is bangle.dev ? bangle.dev is a collection of components for building powerful editing exp

null 553 Dec 29, 2022
A markdown editor. http://lab.lepture.com/editor/

Editor A markdown editor you really want. Sponsors Editor is sponsored by Typlog. Overview Editor is not a WYSIWYG editor, it is a plain text markdown

Hsiaoming Yang 2.8k Dec 19, 2022
A chrome extension which helps change ace editor to monaco editor in web pages, supporting all features including autocompletes.

Monaco-It Monaco-It is a chrome extension turning Ace Editor into Monaco Editor, supporting all features including autocompletes. 一些中文说明 Supported Lan

null 3 May 17, 2022
Typewriter is a simple, FOSS, Web-based text editor that aims to provide a simple and intuitive environment for you to write in.

Typewriter Typewriter is a simple, FOSS, Web-based text editor that aims to provide a simple and intuitive environment for you to write in. Features S

Isla 2 May 24, 2022
Verbum is a fully flexible text editor based on lexical framework.

Verbum Verbum - Flexible Text Editor for React Verbum is a fully flexible rich text editor based on lexical-playground and lexical framework. ⚠️ As th

Ozan Yurtsever 560 Dec 29, 2022
The next generation Javascript WYSIWYG HTML Editor.

Froala Editor V3 Froala WYSIWYG HTML Editor is one of the most powerful JavaScript rich text editors ever. Slim - only add the plugins that you need (

Froala 5k Jan 1, 2023
Ace (Ajax.org Cloud9 Editor)

Ace (Ajax.org Cloud9 Editor) Note: The new site at http://ace.c9.io contains all the info below along with an embedding guide and all the other resour

Ajax.org B.V. 25.2k Jan 4, 2023
In-browser code editor

CodeMirror CodeMirror is a versatile text editor implemented in JavaScript for the browser. It is specialized for editing code, and comes with over 10

CodeMirror 25.6k Dec 30, 2022