格式工具栏

New version available, I fixed the incompatibility of some icons with the latest version of Discourse (that includes FontAwesome 5).

It was easier that I thought, but if you have any issue, let me know

I also changed the icon of the color’s button : instead of the paint brush, we will use the palette. Here are all the icons available:

I think it suits the button better.


If you have a fork on this plugin with custom buttons, the update is pretty easy, you just have to edit your plugin.rb file (example : line 20 to 27 : discourse-formatting-toolbar/plugin.rb at master · MonDiscourse/discourse-formatting-toolbar · GitHub)

You have to register any icon you use. Search for your icon here : Find Icons with the Perfect Look & Feel | Font Awesome

If the icon is in ‘solid’ category, add :
register_svg_icon "fa-icon_name" if respond_to?(:register_svg_icon)
ex : register_svg_icon "fa-underline" if respond_to?(:register_svg_icon)

If the icon is in ‘regular’ category, add
register_svg_icon "far-icon_name" if respond_to?(:register_svg_icon)
ex : register_svg_icon "far-address-book" if respond_to?(:register_svg_icon)

If the icon is in ‘brand’ category, add
register_svg_icon "fab-icon_name" if respond_to?(:register_svg_icon)
ex : register_svg_icon "fab-apple" if respond_to?(:register_svg_icon)

8 个赞

I just installed the plugin on the v2.2.0.beta7 and i have a problem: line spacing between paragraphs collapse when using text formatting: [right], [left], [center], [justify]

See the following example:

The preview on the right window is correct. But then… see next post

1 个赞

After Reply, the text appear correctly first, but after 1-2 seconds the line spacing between the two paragraphs collapses.

1 个赞

Thanks for the feedback, I pushed a fix. Let me know if it works well

For the previous posts, you might need to do a Rebuild HTML to update the code.

image

image

1 个赞

Hi Steven.
No, it doesn’t work. After rebuilding HTML line spacing disappears after a fraction of a second.

2qbhia

My fault! After rebuilding app it works. Thank you Steven.

I love this plugin.

1 个赞

I found another bug. After justifying the text there is an additional line spacing. I’m working with V2.2.0.beta8.

Bug

The behaviour is different from the preview and the cooked post (on preview, it adds the <p> tags for each bbcodes, not on cooked), I don’t really know where it comes from, I don’t know if it’s something I can fix on my part

edit : wait I have an idea, I can fix it in a few hours

Hi Steven, if I put only one [right] in the first line and a [/right] at the end of the last line, it works correctly.

1 个赞

I did a little upgrade to prevent this different behaviour between preview and cooked post. I should have thought about that before :man_facepalming:

I’ll check the source of the bbcodes later, maybe I can do something better than a css fix, but it should be good for now

Thanks for your feedbacks

1 个赞

how is it recommended to clear a left or right float?

“clear:both;” in a div tag does not seem to work

Also any advice on floating or centering a youtube embed?

I can create a clear bbcode, I did it on a customized version of this plugin, I will add it to the official.

It will be [floatc][/floatc], with a clear: both css code attached to it

edit :


Regarding the youtube embed, You can try add a line between the bbcodes and the link

image

It should work on preview and cooked post

1 个赞

移动端布局错误

我不是很清楚问题所在,能请您稍微说明一下吗?

我的意思是工具帖子发布在外部。

1 个赞

编辑:哦,我明白问题出在哪了,我会立即修复,请查看更新 @Bank_Live

我需要修改导致此问题的 CSS。

编辑:已修复,感谢报告!

1 个赞

似乎

discourse-formatting-toolbar

现在无法正常工作。

我已经安装并启动了它,但没有任何反应。刷新网页后,仍然没有任何变化。我激活了颜色按钮,但依然没有反应。

1 个赞

您使用的是哪个 Discourse 版本?

我会尽快检查,但似乎没有 Discourse 的提交会导致该插件出现问题。

1 个赞

我刚刚检查过了,这里没有问题。

你安装了什么插件?

你是在 BBCode 中添加十六进制颜色代码吗?例如:[color=#ff3300]文本[/color]

1 个赞

已安装
2.4.0.beta4
(8adec48b33)

奇怪,格式工具栏似乎未激活,

但我应该已经激活了它