# Help us test the rewritten Composer

**URL:** https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679
**Category:** Feature
**Tags:** feedback
**Created:** [19 Outubro , 2015 16:51 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679 "2015-10-19T16:51:38Z")
**Posts on this page:** 20
**Page:** 3

<div class="post-metadata">

### Author: ![Yuun](https://avatars.discourse-cdn.com/v4/letter/y/977dab/32.png) [@Yuun](https://meta.discourse.org/u/Yuun)
#### Post date: [6 Novembro , 2015 22:47 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/44 "2015-11-06T22:47:26Z")

</div>

Emojii box is a bit misaligned (Chrome):

 ![](https://global.discourse-cdn.com/meta/original/3X/c/0/c03d3550997b1822b5bb5fc4c10f247fbea6622d.png)

Checked: okay in Firefox.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [7 Novembro , 2015 00:39 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/45 "2015-11-07T00:39:04Z")

</div>

Thanks! @eviltrout, I got it to work with the new composer. On to the next plugin! 😄

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [7 Novembro , 2015 02:07 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/46 "2015-11-07T02:07:37Z")

</div>

@eviltrout, so I have my next plugin inserting text, I’m just not convinced I’m doing it how it was designed.

My initializer

> <https://github.com/cpradio/discourse-plugin-poll-ui/blob/master/assets/javascripts/discourse/initializers/poll-ui.js.es6#L38-L53>

and my controller

> <https://github.com/cpradio/discourse-plugin-poll-ui/blob/master/assets/javascripts/discourse/controllers/poll-ui.js.es6#L125-L126>

I’ve highlighted the parts that I’ve adjusted/added. Like I said, it works, but for some reason, I think it should be slightly different than the approach I took…

If you have a moment to take a look and offer a suggestion, I’d really appreciate it!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [7 Novembro , 2015 02:38 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/47 "2015-11-07T02:38:46Z")

</div>

iPad composer behavior is problematic, composer appears and then disappears immediately (at least in landscape)

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [7 Novembro , 2015 08:47 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/48 "2015-11-07T08:47:41Z")

</div>

The pop up for adding links appears inside the composer instead of the main page:

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

The link insertion is also flawed. If I mark `this text to be linked` and enter a link for it I should get `[this text to be linked](http://example.com)` but it replaces the highlighted text with the link as such: `[http://example.com](http://example.com)`

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [7 Novembro , 2015 12:36 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/49 "2015-11-07T12:36:45Z")

</div>

Here is a fix for the selected text to link  
[https://github.com/discourse/discourse/pull/3891](https://github.com/discourse/discourse/pull/3891)

---

<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: [7 Novembro , 2015 15:41 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/50 "2015-11-07T15:41:14Z")

</div>

I don’t want to ask too much of you all, but what would be the best way to add a simple new button (using a bbcode already existing) ?

For example a spoiler button using the `[spoiler][/spoiler]` bbcode

Based on the discourse commit and @cpradio plugin, I have something like that :

_/assets/javascripts/discourse/initializers/spoiler.js.es6_

```
import { onToolbarCreate } from 'discourse/components/d-editor';

onToolbarCreate(toolbar => {
  toolbar.addButton({
    id: "spoiler-button",
    group: "extras",
    icon: "eye-slash",
    perform: e => e.applySurround('[spoiler]', '[/spoiler]', 'text')
    });
});

```

Is it a good start ?

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [7 Novembro , 2015 17:03 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/51 "2015-11-07T17:03:44Z")

</div>

That’s pretty close. Are you getting an error or anything, if you have it on GitHub, I can pull it down and see if I can get it to work.

---

<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: [8 Novembro , 2015 01:54 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/53 "2015-11-08T01:54:17Z")

</div>

A little update, @cpradio made a plugin that works, I was able to add some buttons myself, it’s pretty easy if some people want to add theirs : [GitHub - cpradio/discourse-plugin-spoiler-ui: Spoiler Composer Button for Discourse · GitHub](https://github.com/cpradio/discourse-plugin-spoiler-ui)

Minor bug, I don’t know if it’s the composer or [the plugin](https://meta.discourse.org/t/discourse-spoiler-alert/12650), but the spoiler bbcode doesn’t work on the **preview** , but works fine otherwise

Test

Also, not really a bug, but an observation. When we used an emoji (via the modal), the old editor added one space before and one after the emoji, not in the new one. Not really a problem though

edit : and finally, a little problem for european users, when we type the euro symbol (€ - shortcut : ALT Gr + E) it also opens the emoji modal.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [8 Novembro , 2015 20:21 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/54 "2015-11-08T20:21:44Z")

</div>

> [@Why the editor functionality was changed?](https://meta.discourse.org/t/why-the-editor-functionality-was-changed/35357/1):
>
> I noticed that couple of days ago, the Insert link functionality is broken. Then I started to notice that there are other broken functionality as well:
> 
> - Links
> - Quotes
> - Code
> 
> Basically all previous shortcuts are gone.
> 
> Besides that, if you select a text and add a link on that text, the text will be removed. If you press ctrl+k to insert a link, the browser (chrome, at least) will focus address bar, so you will need to move the mouse, click on the URL field, then add the url.
> 
> Please restore the previous functionality…

So I already submitted a PR for the link text, but I can’t recreate the other issues here on Meta, so I’m not sure there is anything to fix. Might want to make sure you are on latest.

---

<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: [8 Novembro , 2015 20:28 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/55 "2015-11-08T20:28:08Z")

</div>

I think he means, when us use the quote button without any selected text, nothing appears in the text area.

Not really a problem for me, but I think that’s what he meant.

For the code button, the default reaction was the 4 spaces, now it’s the one line version `'indent preformatted text by 4 spaces``. I prefer the new one personnally.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [8 Novembro , 2015 20:34 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/57 "2015-11-08T20:34:11Z")

</div>

> [@Steven](#):
>
> I think he means, when us use the quote button without any selected text, nothing appears in the text area.

Ah, didn’t notice that. I had only used it with selected text. 😄

> [@Steven](#):
>
> For the code button, the default reaction was the 4 spaces, now it’s the one line version 'indent preformatted text by 4 spaces`. I prefer the new one personnally.

Yeah, unless you have text, then it preformats your selected text using the 4 spaces method (when multiple lines are selected, if the text is on a single line it seems to use code fences. – cool

---

<div class="post-metadata">

### Author: ![iamntz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamntz/32/114670_2.png) [@iamntz](https://meta.discourse.org/u/iamntz)
#### Post date: [8 Novembro , 2015 21:00 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/58 "2015-11-08T21:00:48Z")

</div>

> [@Steven](#):
>
> I think he means

I guess _he_ means about (old) shortcuts on quotes, code and so on. But then _he_ read this topic and _he_ now understood why things are broken now. 😄

When you guys will decide to normalize shortcuts with other editors, please compare to other _markdown_ editors, not with editors in general (i.e. how the editor on stack overflow works?).

A small suggestion: please try to make a smart shortcuts for bold/italic. This means that if you press ctrl+i, you get the stars. If you start typing then press ctrl+i again another set of stars are inserted, when it should just skip the star.

See here a sample:

_Mod edit: video link broken_

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [8 Novembro , 2015 22:49 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/59 "2015-11-08T22:49:30Z")

</div>

> [@gerhard](#):
>
> - The quote button should insert some example text, when nothing was selected. Yes, I know the current editor doesn’t do it either, but it should. All the other buttons do.
> - The buttons that insert list items should select only the “List item” text, not the bullet point or number.

Would be great if those things could be changed…

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [9 Novembro , 2015 17:02 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/62 "2015-11-09T17:02:02Z")

</div>

So whilst researching the quoted text button and list items only selecting the text that should change (which present a LOT of edge cases if you adjust them!)

I found this  
[https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/components/d-editor.js.es6#L339](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/components/d-editor.js.es6#L339)

It seems to reason that the line should actually read as `this._selectText(sel.start + hlen, contents.length - hlen - tlen)`, for cases where the tailing tag being inserted is not the same length as the heading tag (think `[spoiler]my test[/spoiler]`)

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [9 Novembro , 2015 21:04 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/63 "2015-11-09T21:04:13Z")

</div>

It’s not possible to see the bottom of a topic anymore when the editor is visible. The new editor seems to be layered on top of the posts.

It’s not really a big issue as long as the editor height is the same as the height of the suggested topics. But this is kinda annoying when I resize the editor or when there are no suggested topics (answering a private message).

---

<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: [9 Novembro , 2015 22:38 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/64 "2015-11-09T22:38:24Z")

</div>

Another little problem, if we type a long text, the scrolling in the preview doesn’t follow the scrolling in the composer. In the preview, if we don’t scroll manually, it stays at the beginning of the post.

---

<div class="post-metadata">

### Author: ![Yuun](https://avatars.discourse-cdn.com/v4/letter/y/977dab/32.png) [@Yuun](https://meta.discourse.org/u/Yuun)
#### Post date: [9 Novembro , 2015 22:52 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/65 "2015-11-09T22:52:04Z")

</div>

Markdown links appear to be broken:

e.g.:

`[google](www.google.com)`

google

(tested in Chrome, Firefox)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [9 Novembro , 2015 22:52 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/66 "2015-11-09T22:52:13Z")

</div>

We used to extend blank onto the footer so you can always see everything regardless of size

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [9 Novembro , 2015 23:00 UTC](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679/67 "2015-11-09T23:00:38Z")

</div>

> [@Yuun](#):
>
> Markdown links appear to be broken:
> 
> e.g.:
> 
> `[google](www.google.com)`
> 
> google
> 
> (tested in Chrome, Firefox)

No, it simply requires the http

`[google](http://www.google.com)`

[google](http://www.google.com)

[Previous page](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679.md?page=2)

[Next page](https://meta.discourse.org/t/help-us-test-the-rewritten-composer/34679.md?page=4)
