Open-source project
jejacks0n/mercury avatar
jejacks0n/mercury

Mercury Editor: WYSIWYG inline editing for Rails via HTML5 contentEditable

Mercury Editor: The Rails WYSIWYG editor that allows embedding full page editing capabilities directly inline.

2,632 stars520 forksJavaScriptNOASSERTION

At a glance

What is it?
Mercury Editor is a CoffeeScript-and-jQuery WYSIWYG editor for Rails 3.2 that uses HTML5 contentEditable on block elements instead of iframes. The repository carries a deprecated-repo topic tag, and the author's Developer Note in the README states the master branch is no longer maintained.
Who is it for?
Mercury Editor solves one problem: giving a Rails application an inline WYSIWYG editing mode where CSS continues to apply to editable regions. For that task, the gem and its three generators give a working starting point.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 4 days ago.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 11, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Editing without iframes: how HTML5 contentEditable keeps CSS on the page

Traditional WYSIWYG editors such as TinyMCE and CKEditor place an iframe around the editable area. Styles defined on the outer page stop applying inside that iframe, so a heading font or custom spacing rule becomes invisible to the person writing content, because the iframe creates a separate document context.

What changes with Mercury's approach is the document context itself. Block elements on the actual page carry the contentEditable attribute, so editing and rendering share one DOM tree. The CSS that styles the published version of a paragraph also styles it in edit mode.

The toolbar appears once per page, not once per region. Mercury makes no provision for per-region toolbars: the same controls cover all editable areas, and the README describes this as the intended design.

Three generators from mercury-rails: configuration, image upload and authentication

Mercury ships as a Rails gem under the name mercury-rails. Adding it to a Gemfile is the first step:

ruby
gem 'mercury-rails'

After bundling, the main generator sets up the configuration:

bash
rails generate mercury:install

/app/assets/javascripts/mercury.js is where the configuration and the Sprockets manifest for Mercury's assets both land after the generator runs.

A second generator handles image upload scaffolding:

bash
rails generate mercury:install:images

The --orm=mongoid flag steers the image generator toward Mongoid; without it, the output targets ActiveRecord and a migration is still needed. The Gemfile gains paperclip after the image generator runs, with mongoid_paperclip added when --orm=mongoid was used.

Authentication gets its own generator:

bash
rails generate mercury:install:authentication

What the authentication generator creates is a hook point in MercuryController with no logic yet. Adding the actual checks is left to the developer, because the necessary logic differs too much across applications to generalize.

For non-Rails environments, the README points to a zip archive last packaged as mercury-v0.9.0.zip. The gh-pages branch is mentioned as a resource for integrating the Mercury bundle into a static site.

Full HTML, Markdown, Snippet, Image and Simple: the five region types and what the README documents

Full HTML, Markdown, Image and Simple lack documentation beyond their names in the 'Custom Regions' entry of the README. Only Snippet comes with a behavioral description: the README calls this content 'predefined and reusable bits of markup/code', placed by drag and drop.

Having five distinct types matters because the editing surface a Mercury page presents depends entirely on which type each area carries. A page that needs different constraints in different areas maps each area to a different region type. How the Full HTML, Markdown, Image and Simple types enforce or relax constraints is not documented in the README beyond their names.

Image drag-and-drop, YouTube and Vimeo embeds, and the table editor

A desktop file dragged into a Mercury region gets picked up, sent to the back-end upload endpoint created by the mercury:install:images generator, and placed in the region automatically.

For video, the media tools work with YouTube and Vimeo. Those are the two services named in the README's Features list; nothing there covers other video platforms or self-hosted files. A project that needs video from a different source has to handle that integration separately.

For tables, the README uses the phrase 'column and rows spans' to describe what the table editor handles. That phrasing covers both multi-column and multi-row spans in a single cell, going further than basic table editing, which stops at adding rows and columns to a fixed grid.

The link tool distinguishes between external URLs and in-page anchors for table-of-contents entries and bookmarks. A preview toggle is available during editing, showing the rendered output without leaving the editor context. Mercury's I18n system is described in the README as 'low profile', built in as a default rather than requiring a separate gem.

Browser version floors: Internet Explorer 10, Chrome 10, Firefox 4, Safari 5 and Opera 11.64

Mercury sets a floor rather than a ceiling for browser support. The floor given in the README is Internet Explorer 10, Chrome 10, Firefox 4, Safari 5, Opera 11.64 and Mobile Safari on iOS 5.

Mercury's browser policy starts from the W3C content editing specification rather than from installed-base data. A browser that implements the spec is supported; one that diverges from it is not. No plans to add support for non-conforming implementations are mentioned in the README.

For the listed browsers, there is no compatibility matrix beyond the version floors. A project evaluating Mercury needs to test against its actual audience's browser distribution, because the README documents no results for specific versions within the supported ranges.

TinyMCE, CKEditor and the seven alternatives the README names

The README names seven editors for readers who decide Mercury does not fit: Aloha Editor, jHtmlArea, MarkItUp, TinyMCE, CKEditor, NicEdit and Raptor Editor. TinyMCE and CKEditor are the primary reference points, because the README opens by describing Mercury as 'much like TinyMCE or CKEditor, but with a different usage paradigm.'

That paradigm difference is the one already described: TinyMCE and CKEditor use iframes, while Mercury uses contentEditable. For an application where CSS continuity between the published page and the editing surface makes no practical difference, those iframe-based editors are established options with active documentation and community support.

The list itself is unusual. A README that presents alternatives usually does so without admitting they might be a better fit; Mercury's does not, naming seven editors and noting that browser coverage or feature gaps may point toward one of them instead.

Rails 3.2, CoffeeScript and what the repository layout and topic tags reveal

On the client, Mercury is CoffeeScript and jQuery; on the server, it expects Rails 3.2. Adopting the gem means taking on those dependencies, along with paperclip from the image upload generator and mongoid_paperclip when the Mongoid variant is selected. The README documents no compatibility with Rails versions after 3.2.

A reader who checks the repository's topic tags and the Developer Note together finds a detail a quick scan would miss: the repository carries the topic tag deprecated-repo, the Developer Note states the master branch is 'no longer maintained by me', and the last push to that branch was dated 2026-10-06. Both signals point to the mercury2 branch as the project's destination while the master branch continues to carry a recent timestamp.

The repository layout covers the expected files: .gitignore, .travis.yml, Gemfile, Rakefile, a mercury-rails.gemspec, an app/ directory and a spec/ directory. Anyone tracing the build setup can start from the gemspec and Rakefile. Before deciding which branch to evaluate, confirm the mercury2 branch's Rails version target and recent commit history.

Editorial conclusion

Mercury Editor solves one problem: giving a Rails application an inline WYSIWYG editing mode where CSS continues to apply to editable regions. For that task, the gem and its three generators give a working starting point. Do not adopt it for a new project. The repository carries a deprecated-repo tag, the Developer Note says the master branch is no longer maintained, and the gem was written for Rails 3.2 with CoffeeScript and jQuery. Confirm your application runs Rails 3.2 before spending time evaluating it, because the README documents no compatibility with later versions. Read the custom licence file before any redistribution.

Frequently asked questions

What is Mercury Editor?

Mercury Editor is a WYSIWYG editor for Rails applications that uses HTML5 contentEditable on block elements instead of iframes, allowing the page's own CSS to apply during editing. It displays one shared toolbar for all editable regions and provides five built-in region types: Full HTML, Markdown, Snippet, Image and Simple.

How do I install Mercury Editor in a Rails application?

Add mercury-rails to your Gemfile and run bundle, then run rails generate mercury:install. That generator creates /app/assets/javascripts/mercury.js as both a configuration file and a Sprockets manifest. Two further generators handle image upload scaffolding and authentication separately.

Is Mercury Editor still maintained?

The README's Developer Note states the master branch version is no longer maintained by the author, and the repository carries a deprecated-repo topic tag. The mercury2 branch is named as the destination for future development.

What browsers does Mercury Editor support?

The README lists six: Internet Explorer 10 and later, Chrome 10 and later, Firefox 4 and later, Safari 5 and later, Opera 11.64 and later and Mobile Safari on iOS 5 and later. Support covers browsers that implement the W3C content editing specification.

Can Mercury Editor be used without Rails?

The README points to a zip archive last packaged as mercury-v0.9.0.zip for non-Rails use. The gh-pages branch is mentioned as a resource showing how the Mercury bundle integrates into a static, non-Rails site.

Official sources

  1. Issues
  2. jejacks0n/mercury on GitHub
  3. Project website
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/jejacks0n-mercury.svg)](https://hysenlabs.com/projects/jejacks0n-mercury)