1616public class Main {
1717private static final Pattern PATTERN =Pattern .compile ("\\ r?\\ n" );
1818
19- private static void fillFilesRecursively (
20- Path directory ,final List <File >resultFiles )
19+ private static void fillFilesRecursively (Path directory ,final List <File >resultFiles )
2120throws IOException {
2221Files .walkFileTree (
2322directory ,
@@ -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 };
7084String []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+ "<" ,
105+ ">" ,
106+ "&"
107+ };
108+ String []toStr2 = {
109+ "<code>" ,"</code>" ,"<sub>" ,"</sub>" ,"<sup>" ,"</sup>" ,"<ins>" ,
110+ "</ins>" ,
82111 };
83112String readmeMdJavadoc =
84113"/**\n "
85114 +StringUtils .replaceEach (
86- PATTERN .splitAsStream (readmeMdText )
87- .map (
88- line -> {
89- String firstLine =
90- line .replace (
91- "\\ ." ,
92- " -" )
93- +"\\ ." ;
94- String str =
95- index [0 ]++ ==0
96- ?firstLine
97- :line ;
98- return line .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+ String firstLine =
120+ line
121+ .replace (
122+ "\\ ." ,
123+ " -" )
124+ +"\\ ." ;
125+ String str =
126+ index [0 ]++
127+ ==0
128+ ?firstLine
129+ :line ;
130+ return line
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> **" )