Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
gpt_markdown
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
saminsohag
2025-07-04 22:18:47 +0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
09b95afb3b478ab48702deb55e7fccee3933aff8
09b95afb
1 parent
a554e674
underlined md added
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
3 deletions
example/lib/main.dart
lib/markdown_component.dart
example/lib/main.dart
View file @
09b95af
...
...
@@ -451,9 +451,9 @@ This document was created to test the robustness of Markdown parsers and to ensu
textAlign:
TextAlign
.
justify
,
textScaler:
const
TextScaler
.
linear
(
1
),
style:
const
TextStyle
(
fontFamily:
'monospace'
,
fontWeight:
FontWeight
.
bold
,
),
// fontFamily: 'monospace',
// fontWeight: FontWeight.bold,
),
highlightBuilder:
(
context
,
text
,
style
)
{
return
Container
(
padding:
const
EdgeInsets
.
symmetric
(
...
...
lib/markdown_component.dart
View file @
09b95af
...
...
@@ -24,6 +24,7 @@ abstract class MarkdownComponent {
StrikeMd
(),
BoldMd
(),
ItalicMd
(),
UnderLineMd
(),
LatexMath
(),
LatexMathMultiLine
(),
HighlightedText
(),
...
...
@@ -1164,3 +1165,33 @@ class CodeBlockMd extends BlockMd {
CodeField
(
name:
name
,
codes:
codes
);
}
}
class
UnderLineMd
extends
InlineMd
{
@override
RegExp
get
exp
=>
RegExp
(
r"<u>(.*?)(?:</u>|$)"
,
multiLine:
true
,
dotAll:
true
);
@override
InlineSpan
span
(
BuildContext
context
,
String
text
,
final
GptMarkdownConfig
config
,
)
{
var
match
=
exp
.
firstMatch
(
text
.
trim
());
var
conf
=
config
.
copyWith
(
style:
(
config
.
style
??
const
TextStyle
()).
copyWith
(
decoration:
TextDecoration
.
underline
,
decorationColor:
config
.
style
?.
color
,
),
);
return
TextSpan
(
children:
MarkdownComponent
.
generate
(
context
,
"
${match?[1]}
"
,
conf
,
false
,
),
style:
conf
.
style
,
);
}
}
...
...
Please
register
or
login
to post a comment