回答編集履歴

1

コード

2017/01/28 01:46

投稿

hikochang
hikochang

スコア648

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