Skip to content

content: Handle message links #1048

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

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

rajveermalviya
Copy link
Member

Fixes: #1046

Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rajveermalviya for the rapid implementation! Comments below.

@@ -973,6 +973,14 @@ void main() {
'#mobile-team &gt; zulip-flutter</a></p>',
const LinkNode(url: '/#narrow/stream/243-mobile-team/topic/zulip-flutter',
nodes: [TextNode('#mobile-team > zulip-flutter')]));

testParseInline('parse #-mention of message',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use ContentExample for this, following the comment above:

void main() {
  // When writing test cases in this file:
  //
  //  * Prefer to add a [ContentExample] static and use [testParseExample].
  //    Then add one line of code to `test/widgets/content_test.dart`,
  //    calling `testContentSmoke`, for a widgets test on the same example.

(We can skip the part about a widgets test, since the parsed result here is no different from what we get with existing links.)

Comment on lines 858 to 860
|| (className == 'stream-topic'
|| className == 'stream'
|| className == 'message-link'))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
|| (className == 'stream-topic'
|| className == 'stream'
|| className == 'message-link'))) {
|| className == 'stream-topic'
|| className == 'stream'
|| className == 'message-link')) {

(I think the extra parens are a legacy of how the logic used to be more complicated with classes; introduced in 3cd84bb, simplified in 4c94547 but could have been simplified a bit further.)

@gnprice gnprice added the integration review Added by maintainers when PR may be ready for integration label Nov 6, 2024
@rajveermalviya rajveermalviya force-pushed the pr-content-handle-message-links branch from 247f6d5 to 921eacd Compare November 6, 2024 20:20
@rajveermalviya
Copy link
Member Author

Thanks for the review @gnprice! Pushed a new revision — PTAL.

@gnprice
Copy link
Member

gnprice commented Nov 6, 2024

Thanks! Looks good; merging.

@gnprice gnprice merged commit 921eacd into zulip:main Nov 6, 2024
1 check failed
@rajveermalviya rajveermalviya deleted the pr-content-handle-message-links branch November 6, 2024 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration review Added by maintainers when PR may be ready for integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle message links (a.message-link)
2 participants