// // Copyright 2025 Element Creations Ltd. // Copyright 2025 New Vector Ltd. // // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial. // Please see LICENSE files in the repository root for full details. // enum HTMLFixtures: String, CaseIterable { case plainText case headers case paragraphs case matrixIdentifiers case links case textFormatting case groupedBlockQuotes case separatedBlockQuotes case codeBlocks case unorderedList case orderedList var rawValue: String { switch self { case .plainText: """ Nothing is as permanent as a temporary solution that works. Experience is the name everyone gives to their mistakes. If debugging is the process of removing bugs, then programming must be the process of putting them in. """ case .headers: """

H1 Header

H2 Header

H3 Header

H4 Header

H5 Header
H6 Header
""" case .paragraphs: """

This is a paragraph.

And this is another one.

\
And this is a division.
\ New lines outside of tags are not ignored.\n\nLike so.
\ This line comes after a line break.
""" case .matrixIdentifiers: """ We expect various identifiers to be (partially) detected:
!room:matrix.org, #room:matrix.org, $event:matrix.org, @user:matrix.org
matrix://roomid/room:matrix.org, matrix://r/room:matrix.org, matrix://roomid/room:matrix.org/e/event:matrix.org, matrix://roomid/room:matrix.org/u/user:matrix.org
""" case .links: """ Links too:
Matrix rules! 🤘, beta.org, www.gamma.org, http://delta.org """ case .textFormatting: """ Text formatting should work properly. Text formatting does work!. And mixed formatting works too!!1!. Thumbs if you liked it, sub if you loved it! """ case .groupedBlockQuotes: """
First blockquote with a link in it
Second blockquote with a link in it
Third blockquote with a link in it
""" case .separatedBlockQuotes: """ Text before blockquote\
Some blockquote
\ Text after first blockquote\
Some other blockquote
\ Text after second blockquote """ case .codeBlocks: """
A preformatted code block
            struct ContentView: View {
                var body: some View {
                    VStack {
                        Text("Knock, knock!")
                            .padding()
                            .background(Color.yellow, in: RoundedRectangle(cornerRadius: 8))
                        Text("Who's there?")
                    }
                    .padding()
                }
            }

Followed by some plain code blocks
Hello, world! Hello, world! This link should not be interpreted as such And this https://www.matrix.org should be not highlighted """ case .unorderedList: """ This is an unordered list """ case .orderedList: """ This is an ordered list
  1. Jelly Belly
  2. Starburst
  3. Skittles
""" } } }