anton-zaytsev/elrte-rails — pull request #2 by mchavarriagam (2012-11-07 18:55:54+00:00)
Title: Allow HTML5 data-* attributes by updating attrRegExp property

HTML5 data-* attributes are being stripped out of the HTML markup in the editor because the attrRegExp property doesn't allow non-alpha characters. The regular expression was changed from

this.attrRegExp = /(\w+)(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^\s]+))?/g;

to

this.attrRegExp = /([\w\-]+)(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^\s]+))?/g;

To allow dashes (therefore allowing data-* attributes).

Credit goes to this forum post:

http://elrte.org/redmine/boards/3/topics/4269?r=4270#message-4270

Cheers.