Browse Source

add clap text support

master
mark 2 years ago
parent
commit
031e218111
2 changed files with 7 additions and 0 deletions
  1. +1
    -0
      index.html
  2. +6
    -0
      script.js

+ 1
- 0
index.html View File

@@ -26,6 +26,7 @@
<option value="hacker">Hacker Text (hacker)</option>
<option value="sm64">Donkey Kong (sm64)</option>
<option value="emoji">Emoji (regonal_indicator)</option>
<option value="clapping">Clapping Text 👏</option>
</select>
<textarea placeholder="Input Text" id="inputBox"></textarea>
<textarea id="outputBox" disabled></textarea>


+ 6
- 0
script.js View File

@@ -43,6 +43,12 @@ var replaceMapping = {
replace: ':regional_indicator_$&: ',
postReplaceMatch: [ /regional_indicator_0/g, /regional_indicator_1/g, /regional_indicator_2/g, /regional_indicator_3/g, /regional_indicator_4/g, /regional_indicator_5/g, /regional_indicator_6/g, /regional_indicator_7/g, /regional_indicator_8/g, /regional_indicator_9/g, /regional_indicator_#/g, /regional_indicator_\*/g, /regional_indicator_b/g ],
postReplace: ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'hash', 'keycap_star', 'b' ]
},
clapping: {
regexp: /\s/g,
replace: '👏',
postReplaceMatch: [ /$/ ],
postReplace: [ '👏' ]
}
}



Loading…
Cancel
Save