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
2024-02-15 23:17:12 +0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
04e6826431ef08a2d6803245a8a73d6c7f52c759
04e68264
1 parent
59ace4cb
Added \begin and \end in block type latex
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
gpt_markdown/lib/markdown_component.dart
gpt_markdown/lib/md_widget.dart
gpt_markdown/lib/markdown_component.dart
View file @
04e6826
...
...
@@ -467,7 +467,7 @@ class BoldMd extends InlineMd {
class
LatexMathMultyLine
extends
InlineMd
{
@override
RegExp
get
exp
=>
RegExp
(
r"\\\[(.*?)\\\]"
,
r"\\\[(.*?)\\\]
|(\\begin.*?\\end{.*?})
"
,
dotAll:
true
,
);
...
...
@@ -482,7 +482,7 @@ class LatexMathMultyLine extends InlineMd {
)
{
var
p0
=
exp
.
firstMatch
(
text
.
trim
());
p0
?.
group
(
0
);
String
mathText
=
p0
?[
1
]
?.
toString
()
??
""
;
String
mathText
=
p0
?[
1
]
??
p0
?[
2
]
??
""
;
var
workaround
=
latexWorkaround
??
(
String
tex
)
=>
tex
;
return
WidgetSpan
(
alignment:
PlaceholderAlignment
.
baseline
,
...
...
gpt_markdown/lib/md_widget.dart
View file @
04e6826
...
...
@@ -115,12 +115,13 @@ class MdWidget extends StatelessWidget {
context
,
eachLn
.
replaceAllMapped
(
RegExp
(
r"\\\[(.*
)\\\]
"
,
r"\\\[(.*
?)\\\]|(\\begin.*?\\end{.*?})
"
,
multiLine:
true
,
dotAll:
true
,
),
(
match
)
{
//
String
body
=
match
[
1
]?.
replaceAll
(
"
\n
"
,
" "
)
??
""
;
String
body
=
(
match
[
1
]
??
match
[
2
])?.
replaceAll
(
"
\n
"
,
" "
)
??
""
;
return
"
\\
[
$body
\\
]"
;
}),
style
,
...
...
Please
register
or
login
to post a comment