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
2023-04-07 22:43:25 +0600
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b005391f9e6e4c5bcffe294789f38a412427b1d0
b005391f
1 parent
5b813959
bug fixed
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
5 deletions
tex_markdown/CHANGELOG.md
tex_markdown/example/pubspec.lock
tex_markdown/lib/markdown_component.dart
tex_markdown/pubspec.yaml
tex_markdown/CHANGELOG.md
View file @
b005391
## 0.1.4
*
Bug fixes.
## 0.1.3
*
Bug fixes.
## 0.1.2
*
Bug fixes.
...
...
tex_markdown/example/pubspec.lock
View file @
b005391
...
...
@@ -238,15 +238,15 @@ packages:
path: ".."
relative: true
source: path
version: "0.1.
2
"
version: "0.1.
4
"
tex_text:
dependency: transitive
description:
name: tex_text
sha256: "
46942a9587170f5130d2f7110083abd4335b66d763b0cf6a241c80e74826d71d
"
sha256: "
67e06376b479ab48e8cb2b49e6eafc57f830976bc25bdf791ded089ac989937c
"
url: "https://pub.dev"
source: hosted
version: "0.1.
5
"
version: "0.1.
7
"
tuple:
dependency: transitive
description:
...
...
tex_markdown/lib/markdown_component.dart
View file @
b005391
...
...
@@ -17,6 +17,8 @@ abstract class MarkdownComponent {
HrLine
(),
TextMd
(),
];
/// Convert markdown to html
static
String
toHtml
(
String
text
)
{
String
html
=
""
;
text
.
split
(
RegExp
(
r"\n+"
)).
forEach
((
element
)
{
...
...
@@ -35,6 +37,7 @@ abstract class MarkdownComponent {
return
html
;
}
/// Generate widget for markdown widget
static
Widget
generate
(
BuildContext
context
,
String
text
,
...
...
@@ -103,6 +106,7 @@ abstract class MarkdownComponent {
bool
get
inline
;
}
/// Inline component
abstract
class
InlineMd
extends
MarkdownComponent
{
@override
bool
get
inline
=>
true
;
...
...
@@ -115,6 +119,7 @@ abstract class InlineMd extends MarkdownComponent {
String
toHtml
(
String
text
);
}
/// Block component
abstract
class
BlockMd
extends
MarkdownComponent
{
@override
bool
get
inline
=>
false
;
...
...
@@ -127,6 +132,7 @@ abstract class BlockMd extends MarkdownComponent {
String
toHtml
(
String
text
);
}
/// Heading component
class
HTag
extends
BlockMd
{
@override
final
RegExp
exp
=
RegExp
(
r"^(#{1,6})\s([^\n]+)$"
);
...
...
@@ -191,6 +197,7 @@ class HTag extends BlockMd {
}
}
/// Horizontal line component
class
HrLine
extends
BlockMd
{
@override
final
RegExp
exp
=
RegExp
(
r"^(--)[-]+$"
);
...
...
@@ -214,6 +221,7 @@ class HrLine extends BlockMd {
}
}
/// Checkbox component
class
CheckBoxMd
extends
BlockMd
{
get
onLinkTab
=>
null
;
...
...
@@ -259,6 +267,7 @@ class CheckBoxMd extends BlockMd {
}
}
/// Radio Button component
class
RadioButtonMd
extends
BlockMd
{
get
onLinkTab
=>
null
;
...
...
@@ -304,6 +313,7 @@ class RadioButtonMd extends BlockMd {
}
}
/// Unordered list component
class
UnOrderedList
extends
BlockMd
{
get
onLinkTab
=>
null
;
...
...
@@ -348,6 +358,7 @@ class UnOrderedList extends BlockMd {
}
}
/// Ordered list component
class
OrderedList
extends
BlockMd
{
@override
final
RegExp
exp
=
RegExp
(
r"^([0-9]+\.)\s([^\n]+)$"
);
...
...
@@ -392,6 +403,7 @@ class OrderedList extends BlockMd {
}
}
/// Bold text component
class
BoldMd
extends
InlineMd
{
@override
final
RegExp
exp
=
RegExp
(
r"^\*{2}(([\S^\*].*)?[\S^\*])\*{2}$"
);
...
...
@@ -425,6 +437,7 @@ class BoldMd extends InlineMd {
}
}
/// Italic text component
class
ItalicMd
extends
InlineMd
{
@override
final
RegExp
exp
=
RegExp
(
r"^\*{1}(([\S^\*].*)?[\S^\*])\*{1}$"
);
...
...
@@ -456,6 +469,7 @@ class ItalicMd extends InlineMd {
}
}
/// Link text component
class
ATagMd
extends
InlineMd
{
@override
final
RegExp
exp
=
RegExp
(
r"^\[([^\s\*].*[^\s]?)?\]\(([^\s\*]+)?\)$"
);
...
...
@@ -500,6 +514,7 @@ class ATagMd extends InlineMd {
}
}
/// Image component
class
ImageMd
extends
InlineMd
{
@override
final
RegExp
exp
=
RegExp
(
r"^\!\[([^\s].*[^\s]?)?\]\(([^\s]+)\)$"
);
...
...
@@ -557,6 +572,7 @@ class ImageMd extends InlineMd {
}
}
/// Text component
class
TextMd
extends
InlineMd
{
@override
final
RegExp
exp
=
RegExp
(
".*"
);
...
...
tex_markdown/pubspec.yaml
View file @
b005391
name
:
tex_markdown
description
:
This package is used to create flutter widget that can render markdown and latex formulas. It is very simple to use and uses native flutter components.
version
:
0.1.
2
version
:
0.1.
4
homepage
:
https://github.com/saminsohag/flutter_packages/tree/main/tex_markdown
environment
:
...
...
@@ -10,7 +10,7 @@ environment:
dependencies
:
flutter
:
sdk
:
flutter
tex_text
:
^0.1.
5
tex_text
:
^0.1.
7
dev_dependencies
:
flutter_test
:
...
...
Please
register
or
login
to post a comment