* Add a button to quote text selected in a message Selecting text in a post in the center channel, RHS or Threads view shows a floating "Quote selection" button at the end of the selection. Clicking it appends the selection as a Markdown blockquote to the message box of the same channel or thread and leaves the caret on an empty line below it, in both the plain text and the WYSIWYG editors. Fixes https://github.com/mattermost/mattermost/issues/39236 * Address review feedback on quoting selected text - Determine the selection direction from its boundary points so a left to right selection that ends on an element containing its start isn't treated as right to left. - Keep a quote queued while the message box is busy rewriting the draft and add it once it's done, but still drop it when the message box can't be used. * Add E2E tests for quoting selected text Cover quoting a selection into the channel message box and posting it with a reply, a right to left selection added after an existing draft, quoting from the RHS into the thread reply box, and typing the reply below the quote in the WYSIWYG editor. Text is selected by dragging the mouse like a user does. * Address UX review feedback on quoting selected text - Keep the Markdown formatting of the quoted text (headings, lists, emphasis, code blocks, links, mentions, hashtags) by converting the selected HTML back to Markdown, in both the plain text and WYSIWYG editors. - Place the quote button next to the first selected character instead of the caret, which browsers report at the end of the previous line when a selection starts at the beginning of a wrapped line. - Don't offer to quote when the target message box can't be used: archived channels, DMs with deactivated users, threads whose root was deleted, or without permission to post. - Make the button reachable with Tab and dismissable with Escape, returning the focus where it was, and show it for selections made without the mouse. - Mix the hover color with the background instead of using transparency. * Update the button visibility ref in a layout effect Writing a ref during render isn't allowed, since React can discard a render without rolling the write back. * Use the shared Turndown converter for quotes Convert quoted selections with utils/turndown.ts, which already handles the markup of rendered messages for pasting, instead of a separate converter, so quoting and copy-pasting a message produce the same Markdown. - Add a rule for user mentions to the shared converter so that they keep the username rather than the display name, for pasting too. - Drop the data-language attribute on code blocks. When only part of a code block is selected, its language label is copied along with the selection instead. * Address dev review feedback on quoting selected text - Don't offer to quote burn-on-read posts, which can't be copied either, so that they aren't kept around after they're deleted. - Leave the user's selection as is instead of narrowing it to the message text, so a selection running into the author name, attachments or reactions can still be copied as a whole. Only the message text is quoted. - Support quoting in channel and thread pop-out windows. --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Mattermost is an open core, self-hosted collaboration platform that offers chat, workflow automation, voice calling, screen sharing, and AI integration. This repo is the primary source for core development on the Mattermost platform; it's written in Go and React, runs as a single Linux binary, and relies on PostgreSQL. A new compiled version is released under an MIT license every month on the 16th.
Deploy Mattermost on-premises, or try it for free in the cloud.
Learn more about the following use cases with Mattermost:
Other useful resources:
- Download and Install Mattermost - Install, setup, and configure your own Mattermost instance.
- Product documentation - Learn how to run a Mattermost instance and take advantage of all the features.
- Developer documentation - Contribute code to Mattermost or build an integration via APIs, Webhooks, slash commands, Apps, and plugins.
Table of contents
- Install Mattermost
- Native mobile and desktop apps
- Get security bulletins
- Get involved
- Learn more
- License
- Get the latest news
- Contributing
Install Mattermost
- Download and Install Mattermost Self-Hosted - Deploy a Mattermost Self-hosted instance in minutes via Docker, Ubuntu, or tar.
- Get started in the cloud to try Mattermost today.
- Developer machine setup - Follow this guide if you want to write code for Mattermost.
Other install guides:
- Deploy Mattermost on Docker
- Mattermost Omnibus
- Install Mattermost from Tar
- Ubuntu 20.04 LTS
- Kubernetes
- Helm
- More server install guides
Native mobile and desktop apps
In addition to the web interface, you can also download Mattermost clients for Android, iOS, Windows PC, macOS, and Linux.
Get security bulletins
Receive notifications of critical security updates. The sophistication of online attackers is perpetually increasing. If you're deploying Mattermost it's highly recommended you subscribe to the Mattermost Security Bulletin mailing list for updates on critical security releases.
Get involved
- Contribute to Mattermost
- Find "Help Wanted" projects
- Join Developer Discussion on a Mattermost server for contributors
- Get Help With Mattermost
Learn more
- API options - webhooks, slash commands, drivers, and web service
- See who's using Mattermost
- Browse over 700 Mattermost integrations
License
See the LICENSE file for license rights and limitations.
Get the latest news
- X - Follow Mattermost on X, formerly Twitter.
- Blog - Get the latest updates from the Mattermost blog.
- Facebook - Follow Mattermost on Facebook.
- LinkedIn - Follow Mattermost on LinkedIn.
- Email - Subscribe to our newsletter (1 or 2 per month).
- Mattermost - Join the ~contributors channel on the Mattermost Community Server.
- IRC - Join the #matterbridge channel on Freenode (thanks to matterircd).
- YouTube - Subscribe to Mattermost.
Contributing
Please see CONTRIBUTING.md. Join the Mattermost Contributors server to join community discussions about contributions, development, and more.




