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-04-23 12:03:22 +0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6109fe2f86122fc18de04a8e9825e8501ce42528
6109fe2f
1 parent
7b2cd243
fixed block components rendering inside table.
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
57 additions
and
15 deletions
.vscode/settings.json
CHANGELOG.md
example/lib/main.dart
example/pubspec.lock
lib/custom_widgets/code_field.dart
lib/custom_widgets/custom_rb_cb.dart
lib/custom_widgets/unordered_ordered_list.dart
lib/fonts/JetBrainsMono-Regular.ttf
lib/markdown_component.dart
pubspec.yaml
.vscode/settings.json
0 → 100644
View file @
6109fe2
{
"cSpell.words"
:
[
"cupertino"
]
}
\ No newline at end of file
...
...
CHANGELOG.md
View file @
6109fe2
## 1.0.17
*
Bloc components rendering inside table.
## 1.0.16
*
`IndentMd` and `BlockQuote`
fixed.
...
...
example/lib/main.dart
View file @
6109fe2
...
...
@@ -383,8 +383,8 @@ This document was created to test the robustness of Markdown parsers and to ensu
Expanded
(
child:
ListView
(
children:
[
AnimatedBuilder
(
animation:
_controller
,
ListenableBuilder
(
listenable:
_controller
,
builder:
(
context
,
_
)
{
return
Container
(
padding:
const
EdgeInsets
.
all
(
8
),
...
...
example/pubspec.lock
View file @
6109fe2
...
...
@@ -86,6 +86,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_highlight:
dependency: transitive
description:
name: flutter_highlight
sha256: "7b96333867aa07e122e245c033b8ad622e4e3a42a1a2372cbb098a2541d8782c"
url: "https://pub.dev"
source: hosted
version: "0.7.0"
flutter_lints:
dependency: "direct dev"
description:
...
...
@@ -127,6 +135,14 @@ packages:
relative: true
source: path
version: "1.0.16"
highlight:
dependency: transitive
description:
name: highlight
sha256: "5353a83ffe3e3eca7df0abfb72dcf3fa66cc56b953728e7113ad4ad88497cf21"
url: "https://pub.dev"
source: hosted
version: "0.7.0"
http:
dependency: transitive
description:
...
...
lib/custom_widgets/code_field.dart
View file @
6109fe2
...
...
@@ -72,7 +72,13 @@ class _CodeFieldState extends State<CodeField> {
SingleChildScrollView
(
scrollDirection:
Axis
.
horizontal
,
padding:
const
EdgeInsets
.
all
(
16
),
child:
Text
(
widget
.
codes
),
child:
Text
(
widget
.
codes
,
style:
TextStyle
(
fontFamily:
'JetBrainsMono'
,
package:
"gpt_markdown"
,
),
),
),
],
),
...
...
lib/custom_widgets/custom_rb_cb.dart
View file @
6109fe2
...
...
@@ -24,6 +24,7 @@ class CustomRb extends StatelessWidget {
return
Directionality
(
textDirection:
textDirection
,
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
textBaseline:
TextBaseline
.
alphabetic
,
crossAxisAlignment:
CrossAxisAlignment
.
baseline
,
children:
[
...
...
@@ -44,7 +45,7 @@ class CustomRb extends StatelessWidget {
),
),
),
Expanded
(
child:
child
),
Flexible
(
child:
child
),
],
),
);
...
...
@@ -75,6 +76,7 @@ class CustomCb extends StatelessWidget {
return
Directionality
(
textDirection:
textDirection
,
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
textBaseline:
TextBaseline
.
alphabetic
,
crossAxisAlignment:
CrossAxisAlignment
.
baseline
,
children:
[
...
...
@@ -90,7 +92,7 @@ class CustomCb extends StatelessWidget {
),
),
),
Expanded
(
child:
child
),
Flexible
(
child:
child
),
],
),
);
...
...
lib/custom_widgets/unordered_ordered_list.dart
View file @
6109fe2
...
...
@@ -38,6 +38,7 @@ class UnorderedListView extends StatelessWidget {
return
Directionality
(
textDirection:
textDirection
,
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
textBaseline:
TextBaseline
.
alphabetic
,
crossAxisAlignment:
CrossAxisAlignment
.
baseline
,
children:
[
...
...
@@ -63,7 +64,7 @@ class UnorderedListView extends StatelessWidget {
),
),
),
Expanded
(
child:
child
),
Flexible
(
child:
child
),
],
),
);
...
...
@@ -104,6 +105,7 @@ class OrderedListView extends StatelessWidget {
return
Directionality
(
textDirection:
textDirection
,
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
textBaseline:
TextBaseline
.
alphabetic
,
crossAxisAlignment:
CrossAxisAlignment
.
baseline
,
children:
[
...
...
@@ -111,7 +113,7 @@ class OrderedListView extends StatelessWidget {
padding:
EdgeInsetsDirectional
.
only
(
start:
padding
,
end:
spacing
),
child:
Text
.
rich
(
TextSpan
(
text:
no
),
style:
_style
),
),
Expanded
(
child:
child
),
Flexible
(
child:
child
),
],
),
);
...
...
lib/fonts/JetBrainsMono-Regular.ttf
0 → 100644
View file @
6109fe2
No preview for this file type
lib/markdown_component.dart
View file @
6109fe2
...
...
@@ -112,7 +112,8 @@ abstract class BlockMd extends MarkdownComponent {
bool
get
inline
=>
false
;
@override
RegExp
get
exp
=>
RegExp
(
r'^\ *?'
+
expString
,
dotAll:
true
,
multiLine:
true
);
RegExp
get
exp
=>
RegExp
(
r'^\ *?'
+
expString
+
r"$"
,
dotAll:
true
,
multiLine:
true
);
String
get
expString
;
...
...
@@ -134,7 +135,10 @@ abstract class BlockMd extends MarkdownComponent {
child:
child
,
);
}
child
=
Row
(
children:
[
Flexible
(
child:
child
)]);
child
=
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Flexible
(
child:
child
)],
);
return
WidgetSpan
(
child:
child
,
alignment:
PlaceholderAlignment
.
baseline
,
...
...
@@ -164,6 +168,7 @@ class IndentMd extends BlockMd {
return
Directionality
(
textDirection:
config
.
textDirection
,
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Flexible
(
child:
config
.
getRich
(
...
...
@@ -257,7 +262,7 @@ class NewLines extends InlineMd {
/// Horizontal line component
class
HrLine
extends
BlockMd
{
@override
String
get
expString
=>
(
r"
(--)[-]+
$"
);
String
get
expString
=>
(
r"
⸻|((--)[-]+)
$"
);
@override
Widget
build
(
BuildContext
context
,
...
...
@@ -554,10 +559,8 @@ class StrikeMd extends InlineMd {
/// Italic text component
class
ItalicMd
extends
InlineMd
{
@override
RegExp
get
exp
=>
RegExp
(
r"(?<!\*)\*(?<!\s)(.+?)(?<!\s)\*(?!\*)|\_(?<!\s)(.+?)(?<!\s)\_"
,
dotAll:
true
,
);
RegExp
get
exp
=>
RegExp
(
r"(?:(?<!\*)\*(?<!\s)(.+?)(?<!\s)\*(?!\*))"
,
dotAll:
true
);
@override
InlineSpan
span
(
...
...
pubspec.yaml
View file @
6109fe2
name
:
gpt_markdown
description
:
"
Powerful
Markdown
&
LaTeX
Renderer
for
Flutter:
Rich
Text,
Math,
Tables,
Links,
and
Text
Selection.
Ideal
for
ChatGPT,
Gemini,
and
more."
version
:
1.0.1
6
version
:
1.0.1
7
homepage
:
https://github.com/Infinitix-LLC/gpt_markdown
environment
:
...
...
@@ -18,6 +18,10 @@ dev_dependencies:
flutter_lints
:
^5.0.0
flutter
:
fonts
:
-
family
:
JetBrainsMono
fonts
:
-
asset
:
lib/fonts/JetBrainsMono-Regular.ttf
topics
:
-
markdown
...
...
Please
register
or
login
to post a comment