The discussion is about improving the behavior of the Markdown formatting buttons in the composer toolbar. Currently, when a user selects a list item or blockquote, the Markdown symbol is also selected, preventing immediate typing. debryc suggests that only the content of the list item or blockquote should be selected, similar to how emphasized and strong text work.
sam agrees with the suggestion and also proposes renaming “strong text” to “bold text” and “emphasized text” to “italicized text” to make it more user-friendly. However, he notes that implementing smarter behavior for bold and italic text would require a lot of magic rules and may not be feasible without a full parser.
debryc suggests including a button that links to Markdown syntax until rich text editing is available. simon confirms that the issue is still present and offers to make a PR to fix it. Moin shares their experience with the formatting toolbar, highlighting its usefulness for those unfamiliar with Markdown.
simon confirms the issue with the composer toolbar and offers to make a PR to fix it.
Hi, I noticed that when a user selects ,
only the content of the emphasized text is selected so that the user can immediately start typing.
This is true for strong text as well.
However, when a user decides to create a ordered list, unordered list, or blockquote, the Markdown keyboard symbol is selected as well, which means that a user can’t immediately stop typing.
This is an annoyance to users who know Markdown, because I need to re-select only the content, and absolutely infuriating for a user who doesn’t because they might not even know what’s wrong.
Can this be updated so that only the content of whatever is being listed or quoted is selected, and not the keyboard symbol itself?
Finally, in the spirit again of helping people who don’t know Markdown. Could “strong text” be replaced with “bold text” and “emphasized text” be replaced with “italicized text”?
I like this suggestion, @codinghorror’s call on the wording here. I agree calling italics emphasised in the tooltip is somewhat confusing. Looking at Stack Exchange sites it uses “Emphasis” and “Strong” so there is precedent even in non tech sites. GitHub uses “Bold” and “Italic”.
Regarding making Italics/Bold smarter. There are quite a few edge cases… for example, when you highlight this block and hit “B” what do you expect?
- test
- text
-test
(3) test
4. test
[spoiler]
test
[/spoiler]
test [i]test
test[/i]
The ideal outcome has a LOT of magic rules, and we don’t want to have to write a full parser here.
I see (1) highlighting text, then hitting “B” as different from (2) not having text and hitting “B”. The first case does have a lot of magic rules. Perhaps until there’s rich text editing (if that’s at all a priority), include a button that links to Markdown syntax? An you know, I think the second case already works very well for “B” and should be replicated for lists and blockquotes.
I’m guessing there’s a call to setSelectionRange that needs to have its start value offset by the length of the markdown syntax (“*” or “1.”) + 1 for the space character.
I don’t think I’d ever used those tool buttons before today. I only noticed the issue because I needed an example of a markdown editor to copy. I wonder how much actual use those buttons get?
The buttons are useful for individuals unfamiliar with markdown. In a community that transitioned from Discourse to Discord, one of the initial feedback from the members was the absence of the formatting toolbar. However, once I had learned the formatting techniques, I found myself preferring to type the formatting commands, but not when using a smartphone or tablet. This is because the buttons are placed near your fingers, making them more accessible than special characters on the keyboard of my phone. This is the reason I use them.
I have also recently reported the issue that was mentioned in the op.