fix(测试跟踪): 导入标签反斜杠字符转义问题
--bug=1017858 --user=宋昌昌 【测试跟踪】github#18427,功能用例模板,标签列带\,导入后编辑功能用例,用例名称和所属模块不显示 https://www.tapd.cn/55049933/s/1265049 Co-authored-by: song-cc-rock <changchang.song@fit2cloud.com>
This commit is contained in:
parent
d60ffba0cb
commit
2e149c411c
|
@ -649,8 +649,10 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener<Map<Integ
|
|||
return "[]";
|
||||
} catch (Exception e) {
|
||||
if (tags != null) {
|
||||
Stream<String> stringStream = Arrays.stream(tags.split("[,;,;\"\\r|\\n|\\r\\n\"]")); //当标签值以中英文的逗号和分号分隔时才能正确解析
|
||||
List<String> tagList = stringStream.map(tag -> tag = "\"" + tag + "\"")
|
||||
//当标签值以中英文的逗号和分号分隔时才能正确解析
|
||||
Stream<String> stringStream = Arrays.stream(tags.split("[,;,;\"\\r|\\n|\\r\\n\"]"));
|
||||
//替换非法字符反斜杠"\"为"\\"
|
||||
List<String> tagList = stringStream.map(tag -> tag = "\"" + tag.replaceAll("\\\\", "\\\\\\\\") + "\"")
|
||||
.collect(Collectors.toList());
|
||||
String modifiedTags = StringUtils.join(tagList, ",");
|
||||
modifiedTags = "[" + modifiedTags + "]";
|
||||
|
|
Loading…
Reference in New Issue