「Wikipediaマークアップ修正」の版間の差分
→ソースコード: 文体の置換に関するコードを除去、正規表現の修正 |
→ソースコード: ソースコードのインデントを半角スペース4文字に統一 |
||
| 29行目: | 29行目: | ||
if (document.selection.Text == "") | if (document.selection.Text == "") | ||
document.selection.SelectAll(); | |||
var s1 = document.selection.Text; | var s1 = document.selection.Text; | ||
| 35行目: | 35行目: | ||
s2 = s1. | s2 = s1. | ||
// Unicode制御文字 | |||
replace(//g, ''). //Left-to-right mark(U+200E)の除去 | |||
replace(//g, ''). //Right-to-left mark(U+200F)の除去 | |||
replace(//g, ''). //Zero width joiner(U+200D)の除去 | |||
replace(//g, ''). //Zero width non-joiner(U+200C)の除去 | |||
replace(//g, ''). //Left-to-right embedding(U+202A)の除去 | |||
replace(//g, ''). //Left-to-right override(U+202D)の除去 | |||
replace(//g, ''). //Pop directional formatting(U+202C)の除去 | |||
replace(//g, ''). //National digit shapes(U+206E)の除去 | |||
replace(//g, ''). //Nominal digit shapes(U+206F)の除去 | |||
replace(//g, ''). //Activate symmetric swapping(U+206B)の除去 | |||
replace(//g, ''). //Inhibit symmetric swapping(U+206A)の除去 | |||
replace(//g, ''). //Activate Arabic form shaping(U+206D)の除去 | |||
replace(//g, ''). //Inhibit Arabic form shaping(U+206C)の除去 | |||
replace(/�/g, ''). //Record Separator(U+001E)の除去 | |||
replace(/�/g, ''). //Unit Separator(U+001F)の除去 | |||
// 全角英数・記号 | |||
replace(/ /g, ' '). | |||
replace(/“|”/g, '"'). | |||
replace(/#/g, '#'). | |||
replace(/$/g, '$'). | |||
replace(/%/g, '%'). | |||
document.selection.Text = s2; | document.selection.Text = s2; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
スポンサーリンク