Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbf9a591

Browse files
committed
Improved escape special characters
1 parentb9094dc commitbf9a591

File tree

1 file changed

+60
-22
lines changed

1 file changed

+60
-22
lines changed

‎src/main/java/generatejavadoc/Main.java

Lines changed: 60 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
publicclassMain {
1717
privatestaticfinalPatternPATTERN =Pattern.compile("\\r?\\n");
1818

19-
privatestaticvoidfillFilesRecursively(
20-
Pathdirectory,finalList<File>resultFiles)
19+
privatestaticvoidfillFilesRecursively(Pathdirectory,finalList<File>resultFiles)
2120
throwsIOException {
2221
Files.walkFileTree(
2322
directory,
@@ -66,6 +65,21 @@ public static void main(String[] args) throws IOException {
6665
"(**",
6766
"**)",
6867
"[[]",
68+
"<code>",
69+
"</code>",
70+
"<sub>",
71+
"</sub>",
72+
"<sup>",
73+
"</sup>",
74+
"<ins>",
75+
"</ins>",
76+
"<",
77+
">",
78+
"&"
79+
};
80+
String[]fromStr2 = {
81+
"[code]","[/code]","[sub]","[/sub]","[sup]","[/sup]","[ins]",
82+
"[/ins]",
6983
};
7084
String[]toStr = {
7185
"(\"{ {",
@@ -78,30 +92,54 @@ public static void main(String[] args) throws IOException {
7892
"** ]",
7993
"( **",
8094
"** )",
81-
"[ []"
95+
"[ []",
96+
"[code]",
97+
"[/code]",
98+
"[sub]",
99+
"[/sub]",
100+
"[sup]",
101+
"[/sup]",
102+
"[ins]",
103+
"[/ins]",
104+
"&lt;",
105+
"&gt;",
106+
"&amp;"
107+
};
108+
String[]toStr2 = {
109+
"<code>","</code>","<sub>","</sub>","<sup>","</sup>","<ins>",
110+
"</ins>",
82111
};
83112
StringreadmeMdJavadoc =
84113
"/**\n"
85114
+StringUtils.replaceEach(
86-
PATTERN.splitAsStream(readmeMdText)
87-
.map(
88-
line -> {
89-
StringfirstLine =
90-
line.replace(
91-
"\\.",
92-
" -")
93-
+"\\.";
94-
Stringstr =
95-
index[0]++ ==0
96-
?firstLine
97-
:line;
98-
returnline.isEmpty()
99-
?" *"
100-
:" * " +str;
101-
})
102-
.collect(Collectors.joining("\n")),
103-
fromStr,
104-
toStr)
115+
StringUtils.replaceEach(
116+
PATTERN.splitAsStream(readmeMdText)
117+
.map(
118+
line -> {
119+
StringfirstLine =
120+
line
121+
.replace(
122+
"\\.",
123+
" -")
124+
+"\\.";
125+
Stringstr =
126+
index[0]++
127+
==0
128+
?firstLine
129+
:line;
130+
returnline
131+
.isEmpty()
132+
?" *"
133+
:" * "
134+
+str;
135+
})
136+
.collect(
137+
Collectors.joining(
138+
"\n")),
139+
fromStr,
140+
toStr),
141+
fromStr2,
142+
toStr2)
105143
.replace("`**","` **")
106144
.replace(",**",", **")
107145
.replace("<ins>**","<ins> **")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp