Web articles detail page & explore feed

This commit is contained in:
2025-07-01 13:19:14 +08:00
parent 8a1af120ea
commit e367fc3f5c
11 changed files with 225 additions and 23 deletions

View File

@ -74,9 +74,7 @@ class MarkdownTextContent extends HookConsumerWidget {
final url = Uri.tryParse(href);
if (url != null) {
if (url.scheme == 'solian') {
context.push(
['', url.host, ...url.pathSegments].join('/'),
);
context.push(['', url.host, ...url.pathSegments].join('/'));
return;
}
final whitelistDomains = ['solian.app', 'solsynth.dev'];
@ -143,17 +141,27 @@ class MarkdownTextContent extends HookConsumerWidget {
),
],
),
generator: MarkdownGenerator(
generators: [latexGenerator],
inlineSyntaxList: [
_UserNameCardInlineSyntax(),
_StickerInlineSyntax(),
LatexSyntax(isDark),
],
linesMargin: linesMargin ?? EdgeInsets.symmetric(vertical: 4),
generator: MarkdownTextContent.buildGenerator(
isDark: isDark,
linesMargin: linesMargin,
),
);
}
static MarkdownGenerator buildGenerator({
bool isDark = false,
EdgeInsets? linesMargin,
}) {
return MarkdownGenerator(
generators: [latexGenerator],
inlineSyntaxList: [
_UserNameCardInlineSyntax(),
_StickerInlineSyntax(),
LatexSyntax(isDark),
],
linesMargin: linesMargin ?? EdgeInsets.symmetric(vertical: 4),
);
}
}
class _UserNameCardInlineSyntax extends markdown.InlineSyntax {