* Treat lists with a single empty item as plain text, not Markdown.
This allows users to send simple messages such as `-`, `+`, `*` and
`2021.` without Element Web mangling them into a nonsensical empty list.
As soon as any non-whitespace content is added to the item, it switches
back to treating it as a list of one item.
Fixesvector-im/element-web#7631.
* Fix type errors.
* Lint.
---------
Co-authored-by: Michael Weimann <michaelw@matrix.org>
Co-authored-by: Johannes Marbach <johannesm@element.io>
* Handle newlines in user pills
Fixes: vector-im/element-web#10994
* Fix typo in comment
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Refactor link generation for better readability
* Use `<br>` instead of `<br/>`
* Fix copy/paste error
---------
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
* Revert "Apply more general fix for base avatar regressions (#10045)"
This reverts commit 371a3c0d36.
* Revert "Fix layout and visual regressions around default avatars (#10031)"
This reverts commit 0d1fce37b2.
* Revert "Member avatars without canvas (#9990)"
This reverts commit a8aa4de4b4.
* Update snapshots
* Strict typechecking fixes for Base/Member/Avatar
Update the core avatar files to pass `--strict --noImplicitAny` typechecks.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Add tests for Base/Member/Avatar
More thoroughly test the core avatar files. Not necessarily the most thorough,
but an improvement.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Extract TextAvatar from BaseAvatar
Extracted the fallback/textual avatar into its own component.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Use standard HTML for non-image avatars
Firefox users with `resistFingerprinting` enabled were seeing random noise
for rooms and users without avatars. There's no real reason to use data
URLs to present flat colors.
This converts non-image avatars to inline blocks with background colors.
See https://github.com/vector-im/element-web/issues/23936
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
* Have pills use solid backgrounds rather than colored images
Similar to room and member avatars, pills now use colored pseudo-elements
rather than background images.
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
---------
Signed-off-by: Clark Fischer <clark.fischer@gmail.com>
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
* 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>
* Tests for roundtrips md<->HTML
* Convert roundtrip tests to it.each table style
* Fix lint errors
* Remove extraneous "f "
Co-authored-by: Travis Ralston <travisr@matrix.org>
* Test __ -> **
* Test for code blocks containing markdown
* Test for more ordered lists
* Test for code blocks with language specifiers
* Additional cases for HTML->markdown->HTML
Co-authored-by: Travis Ralston <travisr@matrix.org>
* 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
* 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>