|
@@ -214,7 +214,7 @@ public class CommonAnalysisUtil {
|
|
|
return;
|
|
|
}
|
|
|
String beforeTitle = null, title = null, newTitle = null, value = null;
|
|
|
- beforeTitle = titles.get(Math.max(depth - 1, 0));
|
|
|
+ beforeTitle = StringUtil.removeBlank(titles.get(Math.max(depth - 1, 0)));
|
|
|
title = titles.get(Math.min(depth, titles.size() - 1));
|
|
|
if (depth == titles.size()) {
|
|
|
value = line;
|
|
@@ -222,7 +222,9 @@ public class CommonAnalysisUtil {
|
|
|
if (value.startsWith(":") || value.startsWith(":")) {
|
|
|
value = value.replaceFirst("[::]", "");
|
|
|
}
|
|
|
- structureMap.put(StringUtil.removeBlank(beforeTitle), value.replace("\n", ""));
|
|
|
+ if (StringUtil.isBlank(structureMap.get(beforeTitle))) {
|
|
|
+ structureMap.put(beforeTitle, value.replace("\n", ""));
|
|
|
+ }
|
|
|
return;
|
|
|
}
|
|
|
if (line.contains(title)) {
|
|
@@ -233,7 +235,9 @@ public class CommonAnalysisUtil {
|
|
|
if (value.startsWith(":") || value.startsWith(":")) {
|
|
|
value = value.replaceFirst("[::]", "");
|
|
|
}
|
|
|
- structureMap.put(StringUtil.removeBlank(beforeTitle), value.trim().replace("\n", ""));
|
|
|
+ if (StringUtil.isBlank(structureMap.get(beforeTitle))) {
|
|
|
+ structureMap.put(beforeTitle, value.trim().replace("\n", ""));
|
|
|
+ }
|
|
|
}
|
|
|
line = line.substring(line.indexOf(newTitle) + newTitle.length());
|
|
|
depth++;
|