* Ignore permalink_prefix when serializing Markdown
fixes vector-im/element-web/issues/26002
During serialization of messages, pills were wrongfully serialized to a URL
starting with `permalink_prefix`. This is against the Spec (which mandates
https://matrix.to/#/ links) and the resulting pills were not recognized as
pills in other clients.
Spec-Appendix concerning matrix.to links: https://spec.matrix.org/v1.8/appendices/#matrixto-navigation
Signed-off-by: Lars Wickel <git@herkulessi.de>
* Test for pill serialization with permalink_prefix set
Signed-off-by: Lars Wickel <git@herkulessi.de>
* Test that permalink_prefix is used for permalink creation
Signed-off-by: Lars Wickel <git@herkulessi.de>
* Fix lint issues introduced
Signed-off-by: Lars Wickel <git@herkulessi.de>
* Incorporate requested changes
Signed-off-by: Lars Wickel <git@herkulessi.de>
---------
Signed-off-by: Lars Wickel <git@herkulessi.de>
Co-authored-by: herkulessi <git@herkulessi.de>
Co-authored-by: David Baker <dbkr@users.noreply.github.com>
* Use `*` for italics as it doesn't break when used mid-word
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Fix tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* 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>