回答編集履歴
1
コード
test
CHANGED
@@ -4,20 +4,24 @@
|
|
4
4
|
|
5
5
|
|
6
6
|
|
7
|
-
|
7
|
+
```JavaScript
|
8
8
|
|
9
|
-
|
9
|
+
text = text.replace(/>[^<>]+</g,'><span class="my_color"$0/span><');
|
10
10
|
|
11
|
-
|
11
|
+
text = text.replace(/^[^<>]+/g,'<span class="my_color">$0<\/span>');
|
12
12
|
|
13
|
-
|
13
|
+
text = text.replace(/>[^<>]+$/g,'><span class="my_color"$0<\/span>');
|
14
14
|
|
15
|
-
|
15
|
+
text = text.replace(/<rt><span class="my_color">/g,'<rt>');
|
16
16
|
|
17
|
-
|
17
|
+
text = text.replace(/<\/span><\/rt>/g,'</rt>');
|
18
18
|
|
19
|
-
|
19
|
+
text = text.replace(/<rp><span class="my_color">/g,'<rp>');
|
20
20
|
|
21
|
-
|
21
|
+
text = text.replace(/<\/span><\/rp>/g,'</rp>');
|
22
22
|
|
23
|
+
text = text.replace(/<ruby><span class="my_color">/g,'<ruby>');
|
24
|
+
|
23
|
-
|
25
|
+
text = text.replace(/<\/span><\/ruby>/g,'</ruby>');
|
26
|
+
|
27
|
+
```
|