Skip to content

Commit

Permalink
fix: parse block description with our HTML parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Sembauke committed Jun 11, 2024
1 parent 231b928 commit 269a08f
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions mobile-app/lib/ui/views/learn/block/block_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:freecodecamp/ui/views/learn/block/block_viewmodel.dart';
import 'package:freecodecamp/ui/views/learn/widgets/download_button_widget.dart';
import 'package:freecodecamp/ui/views/learn/widgets/open_close_icon_widget.dart';
import 'package:freecodecamp/ui/views/learn/widgets/progressbar_widget.dart';
import 'package:freecodecamp/ui/views/news/html_handler/html_handler.dart';
import 'package:freecodecamp/ui/widgets/drawer_widget/drawer_widget_view.dart';

import 'package:stacked/stacked.dart';
Expand Down Expand Up @@ -46,6 +47,8 @@ class BlockView extends StatelessWidget {

bool hasProgress = calculateProgress > 0;

HTMLParser parser = HTMLParser(context: context);

return Column(
children: [
BlockHeader(
Expand Down Expand Up @@ -75,15 +78,9 @@ class BlockView extends StatelessWidget {
vertical: 8,
horizontal: 16,
),
child: Text(
blockString,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
height: 1.2,
fontFamily: 'Lato',
color: Colors.white.withOpacity(0.87),
),
child: Wrap(
children: parser.parse('<p>$blockString</p>',
fontColor: Colors.white),
),
),
if (model.isDev && !isCertification)
Expand Down

0 comments on commit 269a08f

Please sign in to comment.