# Formatting toolbar

**URL:** https://meta.discourse.org/t/formatting-toolbar/40649
**Category:** Plugin
**Created:** [March 6, 2016, 12:39pm UTC](https://meta.discourse.org/t/formatting-toolbar/40649 "2016-03-06T12:39:23Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![EmileKR](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/emilekr/32/151887_2.png) [@EmileKR](https://meta.discourse.org/u/EmileKR)
#### Post date: [March 1, 2017, 11:06am UTC](https://meta.discourse.org/t/formatting-toolbar/40649/25 "2017-03-01T11:06:59Z")

</div>

Oh ok,  
I think the tag is just [left] [/left]

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [March 1, 2017, 11:11am UTC](https://meta.discourse.org/t/formatting-toolbar/40649/26 "2017-03-01T11:11:40Z")

</div>

> [@EmileKR](#):
>
> Oh ok,I think the tag is just [left] [/left]

The funny thing is: [floatl] [/floatl] works. 😕

---

<div class="post-metadata">

### Author: ![trudat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/trudat/32/104354_2.png) [@trudat](https://meta.discourse.org/u/trudat)
#### Post date: [April 1, 2017, 3:55pm UTC](https://meta.discourse.org/t/formatting-toolbar/40649/27 "2017-04-01T15:55:30Z")

</div>

I’m trying to figure out exactly what items this plugin adds to the toolbar.

Comparing the plugin version…

![](https://global.discourse-cdn.com/meta/original/3X/1/a/1aaddd51e6e0db14376ad28b7f497669ed182efa.png)

to the native version…

![](https://global.discourse-cdn.com/meta/original/3X/5/7/5723731fabc31f6480bbbc1bc75d8d51077a664f.PNG)

it appears you’ve got:

- the paintbrush, which is just for color?
- the **T** button, not sure what does.
- the image button, which is sort of redundant
- and the indent button.

Personally, I would just like to see the color option available in core.

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [April 1, 2017, 4:17pm UTC](https://meta.discourse.org/t/formatting-toolbar/40649/28 "2017-04-01T16:17:27Z")

</div>

I also added the underline button.

The T button is the H (heading) button translated in french.

The img button is usefull with the float one, because the copy/paste of a image link won’t work with it.

If you want to hide some buttons, two solutions :

- Add some css on admin/customize with a display: none for the buttons you want to hide.

Notice the _.addimg\_ui\_button_ here, it indicates that the img button will be hidden :

```plaintext
#reply-control .d-editor-button-bar .addimg_ui_button {
        display: none;
    }

```

The other css class if you want to use them :

```
.underline_ui_button
.color_ui_button
.floatl_ui_button
.center_ui_button
.right_ui_button
.justify_ui_button

```

Another solution would be to fork the plugin and delete the parts you don’t want to use, but if you’re not used to github it’s more difficult

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [April 1, 2017, 8:41pm UTC](https://meta.discourse.org/t/formatting-toolbar/40649/29 "2017-04-01T20:41:49Z")

</div>

PR submitted.

Suggestion: it would be super-usefull if you add also a table button  
For now I use a JS script to add a simple table in Html:

 ![](https://global.discourse-cdn.com/meta/original/4X/e/6/f/e6f087acd1625ba00eab1d99b6abd5c4d3d71849.png)

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [April 2, 2017, 5:04pm UTC](https://meta.discourse.org/t/formatting-toolbar/40649/30 "2017-04-02T17:04:03Z")

</div>

Isn’t there a plugin that adds table already ?

I think I saw one, maybe it was @cpradio who did it.

I don’t think I could do a cool button where we can config the number of columns and rows, it would be pretty basic if I do this

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [April 10, 2017, 2:04pm UTC](https://meta.discourse.org/t/formatting-toolbar/40649/31 "2017-04-10T14:04:26Z")

</div>

> [@Steven](#):
>
> it would be pretty basic if I do this

The idea is to embed a simple table. When you have a schema under your eyes is super-simple add new columns and rows (if you need).  
The greatest advantage is that you don’t need to remember (or learn) the html syntax, You can simply copy and paste existing rows and columns and then edit them.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [April 12, 2017, 7:16pm UTC](https://meta.discourse.org/t/formatting-toolbar/40649/32 "2017-04-12T19:16:16Z")

</div>

One major flaw: In mobile view, it misses the preview button…

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [April 12, 2017, 9:39pm UTC](https://meta.discourse.org/t/formatting-toolbar/40649/33 "2017-04-12T21:39:48Z")

</div>

I’ll see if I can figure out a solution for that.

---

<div class="post-metadata">

### Author: ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)
#### Post date: [May 10, 2017, 1:11pm UTC](https://meta.discourse.org/t/formatting-toolbar/40649/34 "2017-05-10T13:11:01Z")

</div>

One of my user referred to me that under certain circumstances the color is added even if you leave blank the hex number.  
He made a mistake when he tried to adding the color (probably a wrong copy/paste) and he wrote:

```
[color=##
]Text[/color]

```

and the Html results:

`<font color="##<br/>">Text</font>`

Saving the message Text is in green

_(just to let you know, I don’t think it’s a mistake that can happen often)_

EDIT: I’m not a coder but probably you need to add some sanitazer to prevent users to insert something potentially malicious or dangerous?

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [May 10, 2017, 4:20pm UTC](https://meta.discourse.org/t/formatting-toolbar/40649/35 "2017-05-10T16:20:08Z")

</div>

Thanks for the feedback, but honestly it’s above my abilities for now

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [July 15, 2017, 12:32am UTC](https://meta.discourse.org/t/formatting-toolbar/40649/36 "2017-07-15T00:32:05Z")

</div>

**Version 2.2** available : no new function for now but I worked on the compatibility with the new markdown-it engine.

You can try the new engine by checking the option `enable experimental markdown it` in the admin settings. The former engine will still work until markdown-it become the default one.

If you have any issue with the buttons or bbcode, please contact me. I tested it for a full day without any log error, but we never know.

Thanks to @Sam for the update of [Discourse BBCode plugin](https://github.com/discourse/discourse-bbcode), allowing me to understand the new engine.

I have a little project for this plugin : a **RTL version** , the bbcode `[right]` is no use to them on the toolbar, `[left]` might be more relevant. I’ll try to do one specific branch for this in a few days/weeks.

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [July 18, 2017, 12:49am UTC](https://meta.discourse.org/t/formatting-toolbar/40649/37 "2017-07-18T00:49:34Z")

</div>

With the latest Discourse update, the plugin might be broken, I’ll try to fix this ASAP

It worked well with the `enable experimental markdown it` option activated but it seems that with the new engine activated by default, it doesn’t work anymore.

If you have any issue after upgrading Discourse since july 17th (especially the preview that does not work and an error 500 while posting), It might be because of my plugin. Sorry for the trouble.

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [July 18, 2017, 11:31pm UTC](https://meta.discourse.org/t/formatting-toolbar/40649/38 "2017-07-18T23:31:00Z")

</div>

The plugin has been upgraded, it is now working with the latest version of Discourse.

I tested it, we can post (that’s the minimum 😅), the bbcodes works, no log errors.

Thanks for your patience 👍🏽

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [July 19, 2017, 7:56am UTC](https://meta.discourse.org/t/formatting-toolbar/40649/39 "2017-07-19T07:56:27Z")

</div>

> [@Steven](#):
>
> I’ll see if I can figure out a solution for that.

Is this also part of the upgrade?

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [July 19, 2017, 10:53am UTC](https://meta.discourse.org/t/formatting-toolbar/40649/40 "2017-07-19T10:53:43Z")

</div>

Not yet. I can try some things tonight.

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [July 19, 2017, 3:50pm UTC](https://meta.discourse.org/t/formatting-toolbar/40649/41 "2017-07-19T15:50:22Z")

</div>

I think the best way would be to hide some buttons on mobile (it is already done by default for link, upload, bullet, list, heading and rule)

You should add this on the Mobile \> CSS sheet in admin \> Customize \> Theme

```css
button.ember-view.btn.no-text.color_ui_button, button.ember-view.btn.no-text.addimg_ui_button, button.ember-view.btn.no-text.floatl_ui_button, button.ember-view.btn.no-text.center_ui_button, button.ember-view.btn.no-text.right_ui_button, button.ember-view.btn.no-text.justify_ui_button, .d-editor-spacer {
    display: none;
}

```

It will hide the following buttons : color, add image, floatl, centrer, right, justify. And the spacer (the `|` between categories of buttons). It should be enough to leave room for the preview button.

If you want to keep one button, we can change the css a little bit. Example : if you want to keep the color button and the spacer

```css
button.ember-view.btn.no-text.addimg_ui_button, button.ember-view.btn.no-text.floatl_ui_button, button.ember-view.btn.no-text.center_ui_button, button.ember-view.btn.no-text.right_ui_button, button.ember-view.btn.no-text.justify_ui_button {
    display: none;
}

```

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [July 19, 2017, 6:03pm UTC](https://meta.discourse.org/t/formatting-toolbar/40649/42 "2017-07-19T18:03:27Z")

</div>

> [@Steven](#):
>
> floatl

Oh, I thought there was no floatl-button. 🙂

> [@Steven](#):
>
> It should be enough to leave room for the preview button.

So that was the only problem? Thanks for fixing it. I’ll try it out once I’m back on my desktop.

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [July 19, 2017, 6:29pm UTC](https://meta.discourse.org/t/formatting-toolbar/40649/43 "2017-07-19T18:29:46Z")

</div>

On my version I always had a floatl button. Maybe EmileKR’s version deleted it (I think you used that one before).

Yes the issue was the size of the toolbar, the last button are hidden (`overflow: hidden;` on the css) if the toolbar is too long. I tried to move the preview button before mine, but I couldn’t do it. The easier solution is to hide some buttons on mobile.

If this solution is good for you, it’s great.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [July 19, 2017, 6:49pm UTC](https://meta.discourse.org/t/formatting-toolbar/40649/44 "2017-07-19T18:49:14Z")

</div>

> [@Steven](#):
>
> On my version I always had a floatl button.

Not that it’s important, but:

> [@Steven](#):
>
> The [floatr][/floatr] bbcode has been created but I didn’t add a button, it doesn’t feel necessary.

[Previous page](https://meta.discourse.org/t/formatting-toolbar/40649.md?page=1)

[Next page](https://meta.discourse.org/t/formatting-toolbar/40649.md?page=3)
