Skip to content

Commit

Permalink
fix: hide front matter in markdown preview
Browse files Browse the repository at this point in the history
  • Loading branch information
sanzoghenzo committed Nov 9, 2023
1 parent 9018bc7 commit 9564db5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class _HomePageState extends State<HomePage> {
late StreamSubscription _intentDataStreamSubscription;
String url = "";
String markdown = "";
String markdownPreview = "";
bool includeSourceLink = false;
bool includeFrontMatter = false;
bool includeExcerpt = false;
Expand Down Expand Up @@ -178,7 +179,7 @@ class _HomePageState extends State<HomePage> {
child: SingleChildScrollView(
scrollDirection: Axis.vertical, //.horizontal
child: showPreview
? MarkdownBody(data: markdown)
? MarkdownBody(data: markdownPreview)
: Text(markdown, softWrap: true),
),
),
Expand Down Expand Up @@ -259,6 +260,7 @@ class _HomePageState extends State<HomePage> {
var excerpt = includeExcerpt ? article!.excerptSection : "";
setState(() {
markdown = "$frontMatter# $title\n\n$link$excerpt$body";
markdownPreview = "# $title\n\n$link$excerpt$body";
});
}

Expand Down

0 comments on commit 9564db5

Please sign in to comment.