Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
1d06eba6
Unverified
Commit
1d06eba6
authored
May 25, 2023
by
Joel
Committed by
GitHub
May 25, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: prompt and preview not show html like tag (#201)
parent
93e99fb3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletion
+5
-1
index.tsx
...iguration/features/chat-group/opening-statement/index.tsx
+2
-0
index.tsx
...components/app/configuration/prompt-value-panel/index.tsx
+1
-1
index.tsx
web/app/components/base/block-input/index.tsx
+2
-0
No files found.
web/app/components/app/configuration/features/chat-group/opening-statement/index.tsx
View file @
1d06eba6
...
...
@@ -58,6 +58,8 @@ const OpeningStatement: FC<IOpeningStatementProps> = ({
const
coloredContent
=
(
tempValue
||
''
)
.
replace
(
regex
,
varHighlightHTML
({
name
:
'$1'
}))
// `<span class="${highLightClassName}">{{$1}}</span>`
.
replace
(
/
\n
/g
,
'<br />'
)
.
replace
(
/</g
,
'<'
)
.
replace
(
/>/g
,
'>'
)
const
handleEdit
=
()
=>
{
...
...
web/app/components/app/configuration/prompt-value-panel/index.tsx
View file @
1d06eba6
...
...
@@ -75,7 +75,7 @@ const PromptValuePanel: FC<IPromptValuePanelProps> = ({
<
div
className=
"max-h-48 overflow-y-auto text-sm text-gray-700 break-all"
dangerouslySetInnerHTML=
{
{
__html
:
format
(
replaceStringWithValuesWithFormat
(
promptTemplate
,
promptVariables
,
inputs
)),
__html
:
format
(
replaceStringWithValuesWithFormat
(
promptTemplate
.
replace
(
/</g
,
'<'
).
replace
(
/>/g
,
'>'
)
,
promptVariables
,
inputs
)),
}
}
>
</
div
>
...
...
web/app/components/base/block-input/index.tsx
View file @
1d06eba6
...
...
@@ -70,6 +70,8 @@ const BlockInput: FC<IBlockInputProps> = ({
const
coloredContent
=
(
currentValue
||
''
)
.
replace
(
regex
,
varHighlightHTML
({
name
:
'$1'
}))
// `<span class="${highLightClassName}">{{$1}}</span>`
.
replace
(
/
\n
/g
,
'<br />'
)
.
replace
(
/</g
,
'<'
)
.
replace
(
/>/g
,
'>'
)
// Not use useCallback. That will cause out callback get old data.
const
handleSubmit
=
()
=>
{
...
...
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