-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(message-parser): Relative URL being displayed as plain text #736
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tassoevan
requested changes
Jun 9, 2022
Benchmark compared with develop branch: Markdown used for the benchmark: # Heading 1
**Paragraph text**: **Bold** Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales, enim et facilisis commodo, est augue venenatis ligula, in convallis erat felis nec nisi. In eleifend ligula a nunc efficitur, ut finibus enim fringilla.
## Heading 2
_Italict Text_: _Italict_ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales, enim et facilisis commodo, est augue venenatis ligula, in convallis erat felis nec nisi. In eleifend ligula a nunc efficitur, ut finibus enim fringilla.
### Heading 3 - Lists, Links and elements
**Unordered List**
- List Item 1
- List Item 2
- List Item 3
- List Item 4
**Ordered List**
1. List Item
2. List Item
3. List Item
4. List Item
> Quote test: **Bold** _Italic_ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales, enim et facilisis commodo, est augue venenatis ligula, in convallis erat felis nec nisi. In eleifend ligula a nunc efficitur, ut finibus enim fringilla.
**Links:**
rocket.chat
google.com
www.google.com
open.rocket.chat
[Google](google.com)
[Rocket.Chat](rocket.chat)
https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351
<https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351|Rocket.Chat Link Test>
[Rocket.Chat Link Test](https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351)
[**Rocket.Chat Link Test**](https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351)
[~~Rocket.Chat Link Test~~](https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351)
[__Rocket.Chat Link Test__](https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351)
[__**~~Rocket.Chat Link Test~~**__](https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351)
[email protected]
+55991991997
# Images
![Image one](https://assets-global.website-files.com/611a19b9853b7414a0f6b3f6/62330c94833bb061e29ff1dc_in-app-chat-messaging-p-800.png)
# Code blocks
`Inline code`
```typescript
const applyMarkdownIfRequires = (
list: MessageAttachmentDefault['mrkdwn_in'] = ['text', 'pretext'],
key: MarkdownFields,
text: string,
variant: 'inline' | 'inlineWithoutBreaks' | 'document' = 'inline',
): ReactNode => (list?.includes(key) ? <MarkdownText parseEmoji variant={variant} content={text} /> : text);```
# Unicode Emojis
😀
😀💅💪🧠
🚀⏰🕰
# ASCII Emojis
:) :( :D :X
# Bult in Emojis
:smile: :rocket: :eyes: :success-kid:
# KaTeX
Easy as \\(E = mc^2\\), right?
\\[
\\f\\relax{x} = \\int_{-\\infty}^\\infty
\\f\\hat\\xi\\,e^{2 \\pi i \\xi x}
\\,d\\xi
\\]
|
tassoevan
approved these changes
Jun 23, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes (including videos or screenshots)
Fixed Relative URLs (without http:// or https://) being displayed as plain text
I also fix this scenario: Links with just one slash were not parsed as link too.
Problems:
![image](https://user-images.githubusercontent.com/20212776/171712944-7fc37092-8c59-42cd-afda-8cd3f4c06877.png)
Issue(s)
Further comments
Steps to reproduce:
[www.uol.com](http://www.uol.com/)
and[meet.google.com/cea-rxwu-qmb](http://meet.google.com/cea-rxwu-qmb)
Actual result:
The messages were sent without being displayed as a link
Expected result:
The messages should be displayed as a link: