Showing
5 changed files
with
18 additions
and
9 deletions
@@ -413,8 +413,12 @@ Markdown and LaTeX can be powerful tools for formatting text and mathematical ex | @@ -413,8 +413,12 @@ Markdown and LaTeX can be powerful tools for formatting text and mathematical ex | ||
413 | }, | 413 | }, |
414 | linkBuilder: | 414 | linkBuilder: |
415 | (context, label, path, style) { | 415 | (context, label, path, style) { |
416 | - // | ||
417 | - return Text(path); | 416 | + return Text( |
417 | + label, | ||
418 | + style: style.copyWith( | ||
419 | + color: Colors.blue, | ||
420 | + ), | ||
421 | + ); | ||
418 | }, | 422 | }, |
419 | // codeBuilder: (context, name, code, closed) { | 423 | // codeBuilder: (context, name, code, closed) { |
420 | // return Padding( | 424 | // return Padding( |
@@ -376,7 +376,7 @@ class UnOrderedList extends BlockMd { | @@ -376,7 +376,7 @@ class UnOrderedList extends BlockMd { | ||
376 | kDefaultFontSize), | 376 | kDefaultFontSize), |
377 | textDirection: config.textDirection, | 377 | textDirection: config.textDirection, |
378 | child: MdWidget( | 378 | child: MdWidget( |
379 | - "${match?[1]}", | 379 | + "${match?[1]?.trim()}", |
380 | config: config, | 380 | config: config, |
381 | ), | 381 | ), |
382 | ); | 382 | ); |
@@ -401,7 +401,7 @@ class OrderedList extends BlockMd { | @@ -401,7 +401,7 @@ class OrderedList extends BlockMd { | ||
401 | style: (config.style ?? const TextStyle()) | 401 | style: (config.style ?? const TextStyle()) |
402 | .copyWith(fontWeight: FontWeight.w100), | 402 | .copyWith(fontWeight: FontWeight.w100), |
403 | child: MdWidget( | 403 | child: MdWidget( |
404 | - "${match?[2]}", | 404 | + "${match?[2]?.trim()}", |
405 | config: config, | 405 | config: config, |
406 | ), | 406 | ), |
407 | ); | 407 | ); |
@@ -736,12 +736,14 @@ class ATagMd extends InlineMd { | @@ -736,12 +736,14 @@ class ATagMd extends InlineMd { | ||
736 | final linkText = match?[1] ?? ""; | 736 | final linkText = match?[1] ?? ""; |
737 | final url = match?[2] ?? ""; | 737 | final url = match?[2] ?? ""; |
738 | 738 | ||
739 | + var builder = config.linkBuilder; | ||
740 | + | ||
739 | // Use custom builder if provided | 741 | // Use custom builder if provided |
740 | - if (config.linkBuilder != null) { | 742 | + if (builder != null) { |
741 | return WidgetSpan( | 743 | return WidgetSpan( |
742 | child: GestureDetector( | 744 | child: GestureDetector( |
743 | onTap: () => config.onLinkTab?.call(url, linkText), | 745 | onTap: () => config.onLinkTab?.call(url, linkText), |
744 | - child: config.linkBuilder!( | 746 | + child: builder( |
745 | context, | 747 | context, |
746 | linkText, | 748 | linkText, |
747 | url, | 749 | url, |
1 | name: gpt_markdown | 1 | name: gpt_markdown |
2 | description: "Powerful Markdown & LaTeX Renderer for Flutter: Rich Text, Math, Tables, Links, and Text Selection. Ideal for ChatGPT, Gemini, and more." | 2 | description: "Powerful Markdown & LaTeX Renderer for Flutter: Rich Text, Math, Tables, Links, and Text Selection. Ideal for ChatGPT, Gemini, and more." |
3 | -version: 1.0.8 | 3 | +version: 1.0.9 |
4 | homepage: https://github.com/Infinitix-LLC/gpt_markdown | 4 | homepage: https://github.com/Infinitix-LLC/gpt_markdown |
5 | 5 | ||
6 | environment: | 6 | environment: |
-
Please register or login to post a comment