Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
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
openSource
apollo
Commits
d250cd20
Commit
d250cd20
authored
May 31, 2016
by
Jason Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handler user input \n in text mode
parent
d0d8945f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
10 deletions
+3
-10
PropertyResolver.java
...k/apollo/portal/service/txtresolver/PropertyResolver.java
+1
-1
ConfigNamespaceController.js
...tatic/scripts/controller/app/ConfigNamespaceController.js
+2
-9
No files found.
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/txtresolver/PropertyResolver.java
View file @
d250cd20
...
...
@@ -127,7 +127,7 @@ public class PropertyResolver implements ConfigTextResolver {
}
String
newKey
=
kv
[
0
];
String
newValue
=
kv
[
1
]
;
String
newValue
=
kv
[
1
]
.
replace
(
"\\n"
,
"\n"
);
//handle user input \n
ItemDTO
oldItem
=
keyMapOldItem
.
get
(
newKey
);
...
...
apollo-portal/src/main/resources/static/scripts/controller/app/ConfigNamespaceController.js
View file @
d250cd20
...
...
@@ -72,15 +72,8 @@ application_module.controller("ConfigNamespaceController",
var
itemCnt
=
0
;
namespace
.
items
.
forEach
(
function
(
item
)
{
if
(
item
.
item
.
key
)
{
var
itemValue
=
item
.
item
.
value
;
if
(
modeType
==
'edit'
)
{
//编辑状态下替换value的换行符
if
(
item
.
item
.
value
&&
(
item
.
item
.
value
.
indexOf
(
"
\
n"
)
>
-
1
))
{
alert
(
"警告:["
+
item
.
item
.
key
+
"]的值包含换行符
\\
n,文本编辑会过滤掉换行符."
);
while
(
itemValue
.
indexOf
(
"
\
n"
)
>
-
1
)
{
itemValue
=
itemValue
.
replace
(
"
\
n"
,
""
);
}
}
}
//use string \n to display as new line
var
itemValue
=
item
.
item
.
value
.
replace
(
/
\n
/g
,
"
\\
n"
);
result
+=
item
.
item
.
key
+
" = "
+
itemValue
+
"
\
n"
;
...
...
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