Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
a6ba9741
authored
Sep 27, 2025
by
heheer
Committed by
GitHub
Sep 27, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: simple prompt editor list render (#5717)
parent
53907af9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
3 deletions
+35
-3
packages/web/components/common/Textarea/PromptEditor/Editor.tsx
+1
-1
packages/web/components/common/Textarea/PromptEditor/index.tsx
+1
-1
packages/web/components/common/Textarea/PromptEditor/utils.ts
+33
-1
No files found.
packages/web/components/common/Textarea/PromptEditor/Editor.tsx
View file @
a6ba9741
...
...
@@ -132,7 +132,7 @@ export default function Editor({
CodeNode
,
CodeHighlightNode
],
editorState
:
textToEditorState
(
value
),
editorState
:
textToEditorState
(
value
,
isRichText
),
onError
:
(
error
:
Error
)
=>
{
throw
error
;
}
...
...
packages/web/components/common/Textarea/PromptEditor/index.tsx
View file @
a6ba9741
...
...
@@ -98,7 +98,7 @@ const PromptEditor = ({
minH=
{
400
}
maxH=
{
400
}
showOpenModal=
{
false
}
value=
{
v
alue
}
value=
{
formattedV
alue
}
onChange=
{
onChangeInput
}
onChangeText=
{
onChange
}
onBlur=
{
onBlurInput
}
...
...
packages/web/components/common/Textarea/PromptEditor/utils.ts
View file @
a6ba9741
...
...
@@ -270,10 +270,42 @@ const buildListStructure = (items: ListItemInfo[]) => {
return
result
;
};
export
const
textToEditorState
=
(
text
=
''
)
=>
{
export
const
textToEditorState
=
(
text
=
''
,
isRichText
=
false
)
=>
{
const
lines
=
text
.
split
(
'\n'
);
const
children
:
Array
<
ParagraphEditorNode
|
ListEditorNode
>
=
[];
if
(
!
isRichText
)
{
return
JSON
.
stringify
({
root
:
{
children
:
lines
.
map
((
p
)
=>
{
return
{
children
:
[
{
detail
:
0
,
format
:
0
,
mode
:
'normal'
,
style
:
''
,
text
:
p
,
type
:
'text'
,
version
:
1
}
],
direction
:
'ltr'
,
format
:
''
,
indent
:
0
,
type
:
'paragraph'
,
version
:
1
};
}),
direction
:
'ltr'
,
format
:
''
,
indent
:
0
,
type
:
'root'
,
version
:
1
}
});
}
let
i
=
0
;
while
(
i
<
lines
.
length
)
{
const
parsed
=
parseTextLine
(
lines
[
i
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment