Commit graph

354 commits

Author SHA1 Message Date
Johannes Marbach
abd39c61b1
Add support for MD / HTML in room topics (#8215)
* Add support for MD / HTML in room topics

Setting MD / HTML supported:
- /topic command
- Room settings overlay
- Space settings overlay

Display of MD / HTML supported:
- /topic command
- Room header
- Space home

Based on extensible events as defined in [MSC1767]

Fixes: vector-im/element-web#5180
Signed-off-by: Johannes Marbach <johannesm@element.io>

[MSC1767]: matrix-org/matrix-spec-proposals#1767

* Fix build error

* Add comment to explain origin of styles

Co-authored-by: Travis Ralston <travpc@gmail.com>

* Empty commit to retrigger build

* Fix import grouping

* Fix useTopic test

* Add tests for HtmlUtils

* Add slash command test

* Add further serialize test

* Fix ternary formatting

Co-authored-by: Travis Ralston <travpc@gmail.com>

* Add blank line

Co-authored-by: Travis Ralston <travpc@gmail.com>

* Properly mock SettingsStore access

* Remove trailing space

* Assert on HTML content and add test for plain text in HTML parameter

* Appease the linter

* Fix JSDoc comment

* Fix toEqual call formatting

* Repurpose test for literal HTML case

* Empty commit to fix CI

Co-authored-by: Travis Ralston <travpc@gmail.com>
Co-authored-by: Travis Ralston <travisr@matrix.org>
2022-06-07 14:20:32 -06:00
Michael Telatynski
e69ba24f96
Fix edge case around composer handling gendered facepalm emoji (#8686)
* Write tests around composer badly handling gendered facepalm emoji

* Commit export for tests to be happy

* Fix edge case around composer handling gendered facepalm emoji

* Fix offset calculations and make code more readable
2022-05-25 12:41:36 +01:00
Travis Ralston
548290b006
Run a minor code quality checker over the repo (#8524)
* Run a minor code quality checker over the repo

Largely targeted at spelling of common words and misc code issues.

* Update snapshots
2022-05-09 22:52:05 +00:00
Michael Telatynski
674aec4050
Fix regression around pasting links (#8537)
* Fix regression around pasting links

* Add tests
2022-05-09 12:39:32 +00:00
Sinharitik589
dfc7224fc7
Converting selected text to MD link when pasting a URL (#8242)
* Converting selected text to MD link when pasting a URL

* Update src/editor/operations.ts

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>

* Converting selected text to MD link when pasting a URL

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2022-05-09 06:34:56 +01:00
Šimon Brandner
b5ac9493dd
Improve pills (#6398) 2022-05-05 11:13:09 +02:00
Michael Telatynski
964c60d086
Apply corrections identified by SonarQube (#8457) 2022-05-03 22:04:37 +01:00
Michael Telatynski
83ab266533
Fix editing of non-html replies (#8418) 2022-04-27 10:43:10 +02:00
Janne Mareike Koschinski
bca9caa98e
Settings toggle to disable Composer Markdown (#8358) 2022-04-19 14:53:59 +01:00
Yaya Usman
6b13988eaa
Fix: "Code formatting button does not escape backticks" (#8181)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2022-04-19 09:20:56 +00:00
Robin
741b13ab6f
Avoid a reflow when setting caret position on an empty composer (#8348)
This saves an extra ~12 ms on each room switch, because we can.
2022-04-17 09:45:34 -04:00
CommanderRoot
c35fc169f5
Replace deprecated String#substr with String#slice (#8314) 2022-04-14 07:52:42 +00:00
Michael Telatynski
04e79dffae
Fix editing <ol> tags with a non-1 start attribute (#8211) 2022-03-31 18:40:51 +01:00
Robin
666cab954a
Fix emoting with emoji or pills (#8105)
* Fix emoting with emoji or pills

* Fix some slash command errors not being shown

* Re-enable mistakenly skipped SendMessageComposer tests

* Test emoting with non-text parts
2022-03-21 19:09:43 +00:00
Travis Ralston
d8a939df5d
Use & enforce snake_case naming convention on config.json settings (#8062)
* Document and support the established naming convention for config opts

This change:
* Rename `ConfigOptions` to `IConfigOptions` to match code convention/style, plus move it to a dedicated file
* Update comments and surrounding documentation
* Define every single documented option (from element-web's config.md)
* Enable a linter to enforce the convention
* Invent a translation layer for a different change to use
* No attempt to fix build errors from doing this (at this stage)

* Add demo of lint rule in action

* Fix all obvious instances of SdkConfig case conflicts

* Fix tests to use SdkConfig directly

* Add docs to make unset() calling safer

* Appease the linter

* Update documentation to match snake_case_config

* Fix more instances of square brackets off SdkConfig
2022-03-18 10:12:36 -06:00
Alexander Stephan
26e6f8deca
Improve formatting features in the editor (#7104)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
2022-03-16 09:46:07 +00:00
Robin
225581de6a
Don't escape pasted text (#8014)
Signed-off-by: Robin Townsend <robin@robin.town>
2022-03-10 08:30:43 -05:00
Robin
c10ac9e4a0
Fix a variety of issues with HTML → Markdown conversion (#8004)
* Fix a variety of issues with HTML → Markdown conversion

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix lint

Signed-off-by: Robin Townsend <robin@robin.town>

* Fix @room pill formatting not being applied to link text

Signed-off-by: Robin Townsend <robin@robin.town>
2022-03-09 07:43:05 -05:00
Šimon Brandner
675b4271e9
Rename MessageComposerInput.insertTrailingComma to MessageComposerInput.insertTrailingColon (#7981) 2022-03-04 15:13:50 +00:00
Michael Telatynski
881307e97c
Fix bad ternary statement in autocomplete user pill insertions (#7977) 2022-03-04 14:01:07 +00:00
Šimon Brandner
4c05b7da1f
Make trailing : into a setting (#6711)
* Make trailing `:` into a setting

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Make traling comma opt-out

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Write `insertTrailingComma` when reading for future opt-in setting

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

* Update src/editor/parts.ts

* Fix line length

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>

Co-authored-by: Travis Ralston <travpc@gmail.com>
2022-03-04 00:23:26 -07:00
Robin
bfab09e977
Use a more correct test for emoji (#7685) 2022-02-01 09:45:22 +00:00
Michael Telatynski
056c7c8d65
Prevent infinite loops by dropping the input instead of crashing browser (#7632) 2022-01-26 10:16:01 +00:00
Michael Telatynski
2143845a3a
Fix issue with the new composer EmojiPart which caused infinite loops (#7629) 2022-01-25 20:22:41 +00:00
Robin
6806c2cdca
Enlarge emoji in composer (#7602) 2022-01-24 12:53:05 +00:00
Michael Telatynski
2ef36507fd
Support deserialising HR tags for editing (#7543) 2022-01-14 13:24:51 +00:00
Michael Telatynski
b835588331
Allow using room pills in slash commands (#7513) 2022-01-12 09:40:18 +00:00
Renan Cleyson
9ac85bcaa3
Fix list formatting alternating on edit (#7422)
Co-authored-by: Andy Balaam <andyb@element.io>
2021-12-21 10:07:44 +00:00
Aaron Raimist
7b94e13a84 Merge branch 'develop' into sort-imports
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2021-12-09 08:34:20 +00:00
Renan Cleyson
b4b81a455e
Fix wrong indentation with nested ordered list unnesting list on edit (#7300) 2021-12-07 09:46:04 +00:00
Aaron Raimist
f3867ad0a9 Merge branch 'develop' into sort-imports 2021-10-27 21:50:56 -05:00
Šimon Brandner
ceb4c7e368
Add insert link button to the format bar (#5879) 2021-10-25 10:56:55 +01:00
Aaron Raimist
bdc56be863
Auto fix
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2021-10-22 17:23:37 -05:00
Michael Telatynski
fd6d853bb1 Allow editing of /rainbow and /rainbowme 2021-10-12 14:02:05 +01:00
Michael Telatynski
ddc408690c Fix EditorModel clone to actually be useful 2021-10-12 11:02:06 +01:00
Michael Telatynski
fe70e64a40 Improve typing 2021-10-12 11:01:40 +01:00
Dariusz Niemczyk
8331d4c7b7
Happily handle empty text messages (#6825)
This commig refactors the message-deletion modal and reuses it for case of removing
the entire message and trying to send it, which should trigger removal flow instead.

Fix vector-im/element-web#18873
2021-09-28 15:04:25 +01:00
Šimon Brandner
fd022310b3
Merge remote-tracking branch 'upstream/develop' into fix/end-of-line-emoji
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-09-11 10:21:56 +02:00
Michael Telatynski
f9527c9d6b Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/a11y/composer-list-autocomplete
 Conflicts:
	src/components/views/rooms/BasicMessageComposer.tsx
	src/editor/autocomplete.ts
2021-08-12 11:21:20 +01:00
Šimon Brandner
422c27fcef
Reorder code
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-08-06 07:46:01 +02:00
Šimon Brandner
4f0c800cad
Merge remote-tracking branch 'upstream/develop' into feature/improved-composer
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-08-06 07:45:17 +02:00
Michael Telatynski
fa550a65af Fix editing of <sub> & <sup> & <u> 2021-07-23 19:01:12 +01:00
Michael Telatynski
ce78cdf4ad Conform to new react and typescript eslint rules 2021-07-19 22:43:11 +01:00
Michael Telatynski
ebfe38dc4a Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/a11y/composer-list-autocomplete
 Conflicts:
	src/components/views/rooms/BasicMessageComposer.tsx
	src/editor/autocomplete.ts
2021-07-15 09:59:40 +01:00
Michael Telatynski
51f0f5718a improve types 2021-07-12 13:26:34 +01:00
Michael Telatynski
8139aeb073 skip loading room & finding member, use existing member field 2021-07-12 12:51:49 +01:00
Michael Telatynski
3515b2ca05 Fix edge case behaviour caused by our weird reuse of DOM nodes between owners 2021-07-12 12:51:27 +01:00
Šimon Brandner
b79f2d0699
Fix the ugly solution
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-07-12 12:21:59 +02:00
Šimon Brandner
113b6319b1
This looks a bit nicer
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-07-12 09:52:01 +02:00
Šimon Brandner
667abca31f
Handle pill onclick
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-07-11 20:02:32 +02:00