<p>Digging into Redactor a little deeper I found that it fails to include <code>&lt;abbr&gt;</code> in its list of inline tags. To add support I made the following modifications to /lib/radactor/redactor.js:</p>

<p>Line 149:</p>

<pre><code>pasteInlineTags: ['br', 'strong', 'ins', 'code', 'del', 'span', 'samp', 'kbd', 'abbr', 'sup', 'sub', 'mark', 'var', 'cite', 'small', 'b', 'u', 'em', 'i'],
</code></pre>

<p>Line 310:</p>

<pre><code>inlineTags: ['a', 'span', 'strong', 'strike', 'b', 'u', 'em', 'i', 'code', 'del', 'ins', 'samp', 'kbd', 'abbr', 'sup', 'sub', 'mark', 'var', 'cite', 'small'],
</code></pre>

<p>I've made Imperavi aware of the omission so hopefully they'll get this sorted in the next release.</p>

<p><strong>Update:</strong> Imperavi have sent a response:</p>

<blockquote>
  <p>We'll add the abbr support including the paste arrays in the next update. </p>
</blockquote>

CC BY-SA 3.0
2017-12-15T04:52:46.760Z
2017-12-19T13:17:53.007Z
2017-12-19T13:17:53.007Z
Joe Spurling
<p>I'm attempting to write a basic plugin for Redactor (Redactor plugin on Craft 3 RC) but I'm tripping at the first hurdle:</p>

<p>It seems I can add any attribute to my <code>&lt;abbr&gt;</code> other than a <code>title</code> (the only attribute I need!). Here is my code so far:</p>

<pre><code>(function($)
{
    $.Redactor.prototype.abbr = function()
    {
        return {
            init: function ()
            {
                var button = this.button.add('abbr', 'Abbreviation');
                this.button.setIcon(button, '&lt;i class="re-icon-toggle"&gt;&lt;/i&gt;');                
                this.button.addCallback(button, function()
                {
                    this.inline.format('abbr', 'title', 'test');
                });
            }
        };
    };
})(jQuery);
</code></pre>

<p>It wraps the selected text in <code>&lt;abbr&gt;</code> but fails to add the title attribute. Other attribute types, such as <code>class</code> work fine:</p>

<p><code>this.inline.format('abbr', 'class', 'test');</code></p>

<p>(In two minds whether to post this here or on SO but as this is for a Craft site...)</p>

CC BY-SA 3.0
2017-12-12T17:32:05.200Z
Are you sure it doesn’t have to do with your field’s “HTML Purifier” settings?
carlcs
CC BY-SA 3.0
2017-12-13T12:39:50.423Z
@carics - sorry for the slow response. I've just tried disabling HTML Purifier on that field but it made no difference. Also tried disabling "clean up HTML" but that didn't help.
Joe Spurling
CC BY-SA 3.0
2017-12-13T13:41:15.317Z
that’s not good, because it’s now very likely that it is a bug in the Redactor code itself. I know that they are stripping out / not allowing certain tags or attributes because they are, for example, using them to temporarily store information.
carlcs
CC BY-SA 3.0
2017-12-13T20:49:19.313Z
@carics - it is a bug in redactor itself but it doesn't seem that abbr is being used for anything. It's just not recognised by redactor as in inline tag. I added it to the inlineTags array (line 310 of redactor.js) and it works fine now. I'll send a message to Imperavi.
Joe Spurling
CC BY-SA 3.0
2017-12-14T16:28:38.780Z
Now that you mention that array, I can remember – it is not very complete. Good luck with your support ticket and you can totally add your comment as an official answer!
carlcs
<redactor>
<abbr> plugin for Redactor
# <abbr> plugin for Redactor

(Asked by: username_0 on 2017-12-12)

I'm attempting to write a basic plugin for Redactor (Redactor plugin on Craft 3 RC) but I'm tripping at the first hurdle:
It seems I can add any attribute to my  other than a title (the only attribute I need!). Here is my code so far:
(function($)
{
    $.Redactor.prototype.abbr = function()
    {
        return {
            init: function ()
            {
                var button = this.button.add('abbr', 'Abbreviation');
                this.button.setIcon(button, '');                
                this.button.addCallback(button, function()
                {
                    this.inline.format('abbr', 'title', 'test');
                });
            }
        };
    };
})(jQuery);

It wraps the selected text in  but fails to add the title attribute. Other attribute types, such as class work fine:
this.inline.format('abbr', 'class', 'test');
(In two minds whether to post this here or on SO but as this is for a Craft site...)

**Tags:** redactor
> **Comments:**
> **username_1**: Are you sure it doesn’t have to do with your field’s “HTML Purifier” settings?  
> **username_0**: @carics - sorry for the slow response. I've just tried disabling HTML Purifier on that field but it made no difference. Also tried disabling "clean up HTML" but that didn't help.  
> **username_1**: that’s not good, because it’s now very likely that it is a bug in the Redactor code itself. I know that they are stripping out / not allowing certain tags or attributes because they are, for example, using them to temporarily store information.  
> **username_0**: @carics - it is a bug in redactor itself but it doesn't seem that abbr is being used for anything. It's just not recognised by redactor as in inline tag. I added it to the inlineTags array (line 310 of redactor.js) and it works fine now. I'll send a message to Imperavi.  
> **username_1**: Now that you mention that array, I can remember – it is not very complete. Good luck with your support ticket and you can totally add your comment as an official answer!  

---

## 1 answers

### Answer by username_0 on 2017-12-15. Score: 2

Digging into Redactor a little deeper I found that it fails to include  in its list of inline tags. To add support I made the following modifications to /lib/radactor/redactor.js:
Line 149:
pasteInlineTags: ['br', 'strong', 'ins', 'code', 'del', 'span', 'samp', 'kbd', 'abbr', 'sup', 'sub', 'mark', 'var', 'cite', 'small', 'b', 'u', 'em', 'i'],

Line 310:
inlineTags: ['a', 'span', 'strong', 'strike', 'b', 'u', 'em', 'i', 'code', 'del', 'ins', 'samp', 'kbd', 'abbr', 'sup', 'sub', 'mark', 'var', 'cite', 'small'],

I've made Imperavi aware of the omission so hopefully they'll get this sorted in the next release.
Update: Imperavi have sent a response:

We'll add the abbr support including the paste arrays in the next update.


---

