Skip to content

added the preview content functionality for the compose box #1061

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

Closed
wants to merge 5 commits into from

Conversation

whodivyanshu
Copy link

No description provided.

InlineSpan _buildStyledText(String text, BuildContext context) {
final boldPattern = RegExp(r'\*\*(.*?)\*\*');
final italicPattern = RegExp(r'\*(.*?)\*');
final codePattern = RegExp(r'```(.*?)```', dotAll: true); // Match ```code```
Copy link
Member

@PIG208 PIG208 Nov 14, 2024

Choose a reason for hiding this comment

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

Hmm. I don't think parsing the message content with regular expressions is the right approach. This will eventually leads to the complexity of re-implementing Zulip's markdown processor from scratch, if we want to have full support of all message content features. A correct implementation should use the render-message endpoint, and reuse the content parser.

@PIG208 PIG208 linked an issue Nov 14, 2024 that may be closed by this pull request
@gnprice
Copy link
Member

gnprice commented Nov 21, 2024

As discussed above, this approach isn't going to work, so I'll close this PR.

@whodivyanshu if you'd like to contribute to Zulip, I recommend finding a more approachable issue to work on.

@gnprice gnprice closed this Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Previews when composing a message (dupe)
3 participants