-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversations improvement #89
Conversation
…ment # Conflicts: # app/lib/shared/errorView.dart
String convertLanisSyntax(String lanisStyledText) {
final markdown = Markdown.map(
{
"**": (text, match) => "<bold>$text</bold>",
"__": (text, match) => "<underline>$text</underline>",
"~~": (text, match) => "<italic>$text</italic>",
"--": (text, match) => "<remove>$text</remove>",
r"regexp: - .(.*)": (text, match) => "<bullet>$text</bullet>", //wird schon gemacht
"`": (text, match) => "<code>$text</code>",
r"regexp: _(\d) ": (text, match) => "<superscript>$text</superscript>",
r"regexp: _\((\d*)\)": (text, match) => "<superscript>$text</superscript>",
r"regexp: \^(\d) ": (text, match) => "<subscript>$text</subscript>",
r"regexp: \^\((\d*)\)": (text, match) => "<subscript>$text</subscript>",
}
);
print(markdown.apply(lanisStyledText));
return markdown.apply(lanisStyledText);
} |
Das sollte eigentlich easy sein mit StyledText. Für links und so weiß ich nicht wie ich es genau mache, aber ich glaube mit Linkify suche ich links und emails heraus und tuhe sie in einen tag rein. |
+ New font: Roboto Mono for Code blocks
sieht sick aus! |
+ Now only bullets that are at the start of the string will be formatted.
…ment # Conflicts: # app/pubspec.yaml
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.
Ich kann es nicht wirklich testen...
Aber da das Text-Styling nicht nur in Conversations verwendet wird, wäre es meiner Meinung nach besser, ein eigenes Widget in Shared zu machen. So könnte man es leichter wiederverwenden. Vor allem für eventuelle zukünftige Applets und Mein Unterricht.
Hab gemacht |
Teil von bessere UI/UX (#40)
Textformatierung
Ich benutze marked, um den Lanis-Syntax zu Markdown-Syntax umzuwandeln. Dann benutze ich styled_text um Widgets mit dem Text zu erstellen. Ist es ist ineffizient? Ja, aber glaube es ist unnötig einen eigenen Parser zu machen mit RegEx oder mit einer String/Char for loop.