-
Notifications
You must be signed in to change notification settings - Fork 309
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
content: Handle message links #1048
Conversation
There was a problem hiding this 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.
test/model/content_test.dart
Outdated
@@ -973,6 +973,14 @@ void main() { | |||
'#mobile-team > 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', |
There was a problem hiding this comment.
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.)
lib/model/content.dart
Outdated
|| (className == 'stream-topic' | ||
|| className == 'stream' | ||
|| className == 'message-link'))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
|| (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.)
247f6d5
to
921eacd
Compare
Thanks for the review @gnprice! Pushed a new revision — PTAL. |
Thanks! Looks good; merging. |
Fixes: #1046