Commit Graph

104 Commits

Author SHA1 Message Date
Stefan Ceriu
827b0ba8f3 Remove more DTCoreText/Foundation references as they are no longer directly imported or used 2026-04-17 10:55:48 +03:00
Stefan Ceriu
53e1cf4ad5 Fix a couple of warnings 2026-02-02 10:37:21 +02:00
Doug
97048b750a Fix inline code being rendered as blocks. (#5017)
* Fix inline code being rendered as blocks.

And make blocks non-greedy as well as only scrolling when needed.

* Rename the bubble layout priorities.

* Add an InlineCode attribute so that the builder also strips links from these too.

* Split up the snapshot tests into individual cases.

This should make it much easier to see *what* has changed when regenerating.
2026-01-28 11:46:13 +00:00
Stefan Ceriu
04053ae69b Update files following swiftformat upgrade 2026-01-27 12:50:57 +02:00
Stefan Ceriu
11af2bb0ca Horizontally scrollable code blocks (#5001)
* Remove attributed string backed codeblock background color

* Add code block support to attributed string componentization

* Render code blocks within their own custom horizontal scroll view within the timeline

* Update preview test snapshots

* Introduce a attributed string component type instead of a 2 different booleans.
2026-01-26 12:39:55 +02:00
Stefan Ceriu
0ede9fffa0 Fix #4856, fix #4431 - Normalise HTML whitespaces using SwiftSoup's own text()/TextNode.normaliseWhitespace methods 2026-01-22 20:11:45 +02:00
Stefan Ceriu
ed126bf2b7 Fix #4913 - Email addresses are detected as URLs 2026-01-12 20:49:31 +02:00
Doug
15720558ef Silence some warnings. (#4747) 2025-11-14 16:59:54 +00:00
Stefan Ceriu
2f9275a0ef Fixes #4683 - Add support for nested lists 2025-11-12 16:54:35 +02:00
Stefan Ceriu
d9c885c48c Fixes #4713, fixes #4648 - Correctly handle span tags and data attributes. 2025-11-07 14:46:01 +02:00
Stefan Ceriu
4448dc94a6 Rename the AttributedStringBuilder file name 2025-10-28 09:53:15 +00:00
Stefan Ceriu
ec15d06154 Remove the first version of the AttributedString builder
Remvoe test stuf

# Conflicts:
#	ElementX/Sources/Other/HTMLParsing/AttributedStringBuilder.swift
#	ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderV1.swift
#	ElementX/Sources/Other/HTMLParsing/DTHTMLElement+AttributedStringBuilder.swift
2025-10-28 09:53:15 +00:00
Mauro
6160c44d67 Update copyright holding and dates (#4640)
* Update copyright holding and dates

* compound IDE Macros updated

* update copyright

* update copyrights done

* update templates and README
2025-10-21 14:34:56 +02:00
Stefan Ceriu
57ec491bac Fixes #4529 - Order out of order ordered list ordering order 2025-09-26 10:48:56 +03:00
Stefan Ceriu
7236c491d5 Remove extra new line before list items and useless paragraph style 2025-09-16 17:54:46 +03:00
Stefan Ceriu
7dd34400e4 Add support for HTML img tags (their alts) on the new AttributedStringBuilder 2025-09-16 17:54:46 +03:00
Stefan Ceriu
1bbeb535a1 Reduce code block font point sizes by 10% on the new attributed string builder. 2025-09-16 17:54:46 +03:00
Stefan Ceriu
93897495e2 Fix traling new lines appearing in attributed string when sending text separated by 2 new lines. 2025-09-12 18:09:18 +03:00
Stefan Ceriu
8e257b40c5 Preserve the formatting of parentless text nodes 2025-09-10 14:52:00 +03:00
Stefan Ceriu
7d59589892 Automatically add insert a new line after headers 2025-09-10 14:52:00 +03:00
Stefan Ceriu
59eb7dd74c Fix the default point size used when applying symbolic traits. 2025-09-09 17:17:40 +01:00
Stefan Ceriu
94a2b86283 Add proper separated blockquotes fixtures and fix the tests. 2025-09-09 17:17:40 +01:00
Stefan Ceriu
9bbff69c69 Mark code blocks with a special attribute and strip away links from them. 2025-09-09 17:17:40 +01:00
Stefan Ceriu
69894ece62 Limit H1, H2 to the H3 point size. 2025-09-09 17:17:40 +01:00
Stefan Ceriu
dead40d2c4 Invalidate caches on both attributed string builders at the same time 2025-09-09 17:17:40 +01:00
Stefan Ceriu
b90d4b6618 Adapt old AttributedStringBuilder tests to the new version and update the HTML fixtures 2025-09-09 17:17:40 +01:00
Stefan Ceriu
97c5b5fb49 Correctly identify MSC4286 span values. 2025-09-09 17:17:40 +01:00
Stefan Ceriu
216d16ddba Add link attributes as URL values instead of String ones 2025-09-09 17:17:40 +01:00
Stefan Ceriu
efbf456067 Remove matrix identifier attributes from code blocks 2025-09-09 17:17:40 +01:00
Stefan Ceriu
afbcd94a5f Extract HTML fixtures out of the FormattedBoxyText previews. 2025-09-09 17:17:40 +01:00
Stefan Ceriu
d52ee31c5b Use the correct key when caching attributed string builder results. 2025-09-09 17:17:40 +01:00
Stefan Ceriu
9796a9d928 Add support for ordered and unordered lists. 2025-09-09 17:17:40 +01:00
Stefan Ceriu
4ac805be19 Add an initial version of the V2 AttributedStringBuilder 2025-09-09 17:17:40 +01:00
Stefan Ceriu
23a5d50067 Add a V2 version of the AttributedStringBuilder as a verbatim copy of the original one (for now) 2025-09-09 17:17:40 +01:00
Stefan Ceriu
bd60a50a7e Move the initial attributed string builder to its own file 2025-09-09 17:17:40 +01:00
Stefan Ceriu
e8cecd448d Rename detectPermalinks to addMatrixEntityPermalinkAttributesTo and move code around 2025-09-09 17:17:40 +01:00
Hugh Nimmo-Smith
60c898f78c Support for experimental MSC4286 to not render external payment details (#4099)
Ref: https://github.com/matrix-org/matrix-spec-proposals/pull/4286
2025-06-03 12:22:14 +01:00
Stefan Ceriu
4c7791ab24 Fix various small errors when running in the Swift 6 language mode (#4109)
* Fix various small errors when running in the Swift 6 language mode

* Make the `TargetConfiguration` run on the main actor.

* Fixed a comment

* Add a comment as to why we can't make the whole NSE a main actor.

* Fix the unit tests

* Fix `blankLinesAtStartOfScope` swiftformat error.
2025-05-13 11:43:47 +03:00
Mauro Romito
81031b12a7 added tests
improvement

improved

improvement

fixed
2025-03-17 16:21:09 +01:00
Mauro Romito
4843bf0f01 phishing alert implementation
we now check when building the string through the `AttributedStringBuilder` if a URL is actually hiding a different link, if so, we create a custom URL that contains both the external and the internal URL to advise the user through an Alert about the risk
2025-03-17 16:21:09 +01:00
Mauro
3d856ce205 Room mentioning in the composer (#3868)
* refactored the suggestion item structure

to scale with the room pill

* Implemented a way for the rooms

to appear in the suggestions view for the RTE, however I need to add the pills to the composer and the compatibility with the plain text composer

* small code correction

* fix

* fixed a bug where the suggestion wasn't returning

the right suggestion type and the suggestion text properly

* implementation done!

also updated some tests, but we need more of them

* updated toolbar view model tests

* updated tests

* updated preview tests

* renamed the Avatars case for the suggestions
2025-03-06 11:32:37 +01:00
Mauro
431828828d Render Room and Message Pills (#3809)
* added a way to render the room and the message

pills, but is WIP

* permalinks now get converted into pills!

* fixed an issue where room address mentions

were not adding a URL properly but a string

* updated tests

* c

* Revert "c"

This reverts commit 5c80252fa23dba7e4d44f2a07fbf1e9500e37c82.

* updated tests

* more tests

* created APIs to get a specific RoomSummary

given the id or the alias

* small mention builder improvement

* pr suggestions
2025-02-25 13:46:01 +00:00
manuroe
c29f4cc9b4 Dual licensing: AGPL + Element Commercial (#3657)
* New LICENSE-COMMERCIAL file

* Apply dual licenses: AGPL + Element Commercial to file headers

* Update README with dual licensing
2025-01-06 11:27:37 +01:00
Doug
bb1686f501 Use the UIColors directly instead of wrapping the SwiftUI Colors. (#3324) 2024-09-24 12:24:03 +01:00
Stefan Ceriu
89eae00479 Switch license to AGPL (#3237)
* Switch license file to AGPL

* Update file copyright headers

* Update the default project file header
2024-09-06 16:34:30 +03:00
Stefan Ceriu
1456c57da0 Ignore punctuation characters at the end of detected links
- fixes permalink handling when that's the case
- prevents deep linking loops between nightly and the main app
2024-06-19 16:10:31 +03:00
Stefan Ceriu
70bf5d0e8d Add support for showing the native OS incoming call screen when starting new Element Calls 2024-05-24 15:32:56 +03:00
Doug
87679329d8 Support tapping Matrix URIs in messages. (#2828) 2024-05-10 15:22:22 +01:00
Stefan Ceriu
62e1ec0464 Prevent links from showing up in color within code blocks, simplify foreground color stripping 2024-05-10 14:07:43 +03:00
Stefan Ceriu
4e670d1502 Reorder AttributedStringBuilder methods based on the order they're called in. 2024-05-09 18:48:51 +03:00