Commit graph

68 commits

Author SHA1 Message Date
Tulir Asokan
ef6de851a2 format/htmlparser: fix generating markdown for code blocks with backticks
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2026-03-13 18:33:22 +02:00
Tulir Asokan
7e07700a69 format: add MarkdownMentionRoomID helper
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled
2025-08-24 00:47:55 +03:00
Tulir Asokan
d2cad8c57e format: add MarkdownMentionWithName helper 2025-08-24 00:44:50 +03:00
Tulir Asokan
78aea00999 format/htmlparser: collapse spaces when parsing html
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-08-10 23:23:15 +03:00
Tulir Asokan
7bd136196d format/htmlparser: don't add link suffix if plaintext is only missing protocol
Auto-linkification will add a protocol in the `href`, but usually won't touch
the text part. We want to undo the linkification here since it doesn't carry
any additional information.
2025-07-29 17:24:01 +03:00
Tulir Asokan
49d2f39183 format: add markdown link utilities 2025-05-24 14:35:00 +03:00
Tulir Asokan
a121a6101c format: accept any string-like type in SafeMarkdownCode
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-04-28 01:00:25 +03:00
Tulir Asokan
287899435d format: add method to quote string in markdown inline code 2025-04-28 00:59:06 +03:00
Tulir Asokan
60e14d7dff format: parse task list html
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-04-13 22:45:51 +03:00
Tulir Asokan
7c1b0c5968 format: add EscapeMarkdown 2025-04-13 02:59:35 +03:00
Tulir Asokan
b72caa948c format/htmlparser: keep <> when converting links without text
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-02-26 22:56:39 +02:00
Tulir Asokan
83e60efa15 format: add markdown renderer for custom emojis
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled
2024-11-02 13:44:51 +02:00
Tulir Asokan
013afd06d3 format/htmlparser: convert math to just latex 2024-11-02 12:37:50 +02:00
Tulir Asokan
0f73c83196 format/mdext: maybe improve math parser 2024-11-02 12:31:23 +02:00
Tulir Asokan
f0c46cf629 format/mdext: add math parser 2024-11-02 11:55:42 +02:00
Tulir Asokan
9f1a8f2cc4 format: add TextToContent helper 2024-11-02 11:55:42 +02:00
Tulir Asokan
a59d4d7867 format: add support for img tags in HTML parser
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled
2024-10-26 14:51:59 +03:00
Tulir Asokan
2a2a576bf4 format/rainbow: move into gomuks 2024-10-17 20:15:32 +03:00
Tulir Asokan
190760cd65 hicli: add support for sending markdown and rainbows 2024-10-12 14:52:21 +03:00
Tulir Asokan
4e180ee36b format/mdext: add indented paragraph fixer
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2024-09-25 16:45:09 +03:00
Tulir Asokan
49b1f240ed format: fix tests
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2024-08-09 23:46:56 +03:00
Tulir Asokan
5735ea3420 format: generate m.mentions when parsing markdown 2024-08-09 23:00:38 +03:00
Tulir Asokan
ea3cd96e25 format/mdext: add single-character bold, italic and strikethrough parsers 2024-08-02 23:53:42 +03:00
Tulir Asokan
423d32ddf6 Add real context to HTML parser context struct 2024-04-13 13:57:30 +03:00
Tulir Asokan
9eb38c70ff Fix imports 2023-01-29 17:11:30 +02:00
Tulir Asokan
389c738c0f Use reflect for filtering parsers to allow better filtering 2023-01-29 17:07:54 +02:00
Tulir Asokan
870a2cfb94 Add utility to remove markdown parser features 2023-01-27 23:23:24 +02:00
Tulir Asokan
4c4238b61f Properly form multi-backtick inline code if code contains backticks 2023-01-27 22:47:19 +02:00
Tulir Asokan
fc6cec1b39 Add some actual context in HTML parser Context 2023-01-27 22:47:19 +02:00
Tulir Asokan
a9a2772689 Add safety for negative indexes in HTML parser 2023-01-15 15:55:37 +02:00
Tulir Asokan
28fbb3851d Fix parsing ordered lists that start at zero 2023-01-15 15:42:14 +02:00
Tulir Asokan
cbf22efc94 Fix comment 2022-07-03 17:56:01 +03:00
Tulir Asokan
5bc36b2978 Add spoiler and color support to HTMLParser 2022-05-29 15:31:39 +03:00
Tulir Asokan
fab91e2b89 Allow mutating text in HTMLParser 2022-05-29 15:16:35 +03:00
Tulir Asokan
04789fc73b Refactor RenderMarkdown to be more modular 2022-05-29 13:55:58 +03:00
Tulir Asokan
55de611c42 Add Discord underline markdown extension 2022-05-29 13:47:38 +03:00
Tulir Asokan
e69aeeb4a6 Add simple spoiler parser
It doesn't support reasons, but nesting works properly
2022-05-29 13:13:54 +03:00
Tulir Asokan
b6f95d2a95 Improve paragraph tag removal 2022-05-29 12:45:37 +03:00
Tulir Asokan
0eee489b64 Switch to /v3 paths everywhere 2022-04-17 12:59:34 +03:00
Tulir Asokan
597a9560f7 Switch from blackfriday to goldmark to add spoiler support 2022-04-15 20:26:27 +03:00
Tulir Asokan
d98d1a815d Remove extra newline after paragraphs
Hopefully it's not needed
2021-08-17 01:28:14 +03:00
Tulir Asokan
75a369f590 Add default PillConverter in HTMLParser 2021-06-16 11:31:49 +03:00
Tulir Asokan
2d9dd44b06 Add generic matrix: URI and matrix.to URL parsing
Closes #34
2021-06-08 16:23:46 +03:00
Tulir Asokan
eef0e65458 Fix HTML tags being allowed in RenderMarkdown even when allowHTML is false 2021-04-29 23:48:43 +03:00
Tulir Asokan
1d493502a1 Fix HTML parser adding extra newline at the end of code blocks 2020-09-04 18:18:29 +03:00
Tulir Asokan
dabb8c5f65 Fix newlines in html-only mode of RenderMarkdown 2020-08-21 20:41:10 +03:00
Tulir Asokan
2c882a33ba Allow storing additional context in HTMLParser result 2020-07-31 14:28:26 +03:00
Tulir Asokan
e8300832e9 Add more tests and comments 2020-04-19 14:54:49 +03:00
Tulir Asokan
f4fc99cddb Overhaul event content representation 2020-04-19 03:23:27 +03:00
Tulir Asokan
941515e73d Rename events to event 2020-04-16 17:29:47 +03:00