/htmlentity-replacer

VSCode extension for quick replacements of accented characters into html entities.

Primary LanguageJavaScriptApache License 2.0Apache-2.0

HTML accented character converter

VSCode extension for quick replacements of accented characters into html entities.

Originally named htmlentity-replacer because I'm pretty bad at naming things.

Demo

Features

This extension adds a command to Visual Studio Code to replace some special characters into html entities. The command will appear in your command palette as Replace special characters with Html entities. The list of supported characters is:

  • Á -> Á
  • á -> á
  • Â -> Â
  • â -> â
  • À -> À
  • à -> à
  • Å -> Å
  • å -> å
  • Ã -> Ã
  • ã -> ã
  • Ä -> Ä
  • ä -> ä
  • Ă -> Ă
  • ă -> ă
  • Ą -> Ą
  • ą -> ą
  • ä -> ä
  • Æ -> Æ
  • æ -> æ
  • ¢ -> ¢
  • œ -> œ
  • Ć -> Ć
  • ć -> ć
  • Ĉ -> Ĉ
  • ĉ -> ĉ
  • Ċ -> Ċ
  • ċ -> ċ
  • Č -> Č
  • č -> č
  • Ď -> Ď
  • ď -> ď
  • Đ -> Đ
  • đ -> đ
  • Ð -> Ð
  • É -> É
  • é -> é
  • Ê -> Ê
  • ê -> ê
  • È -> È
  • è -> è
  • Ë -> Ë
  • ë -> ë
  • Ē -> Ē
  • ē -> ē
  • Ĕ -> Ĕ
  • ĕ -> ĕ
  • Ė -> Ė
  • ė -> ė
  • Ę -> Ę
  • ę -> ę
  • Ě -> Ě
  • ě -> ě
  • ƒ -> ƒ
  • Ĝ -> Ĝ
  • ĝ -> ĝ
  • Ğ -> Ğ
  • ğ -> ğ
  • Ġ -> Ġ
  • ġ -> ġ
  • Ģ -> Ģ
  • ģ -> ģ
  • Ĥ -> Ĥ
  • ĥ -> ĥ
  • Ħ -> Ħ
  • ħ -> ħ
  • ð -> ð
  • Í -> Í
  • í -> í
  • Î -> Î
  • î -> î
  • Ì -> Ì
  • ì -> ì
  • Ï -> Ï
  • ï -> ï
  • Ĩ -> Ĩ
  • ĩ -> ĩ
  • Ī -> Ī
  • ī -> ī
  • Ĭ -> Ĭ
  • ĭ -> ĭ
  • Į -> Į
  • į -> į
  • İ -> İ
  • ı -> ı
  • IJ -> IJ
  • ij -> ij
  • Ĵ -> Ĵ
  • ĵ -> ĵ
  • Ķ -> Ķ
  • ķ -> ķ
  • Ĺ -> Ĺ
  • ĺ -> ĺ
  • Ļ -> Ļ
  • ļ -> ļ
  • Ľ -> Ľ
  • ľ -> ľ
  • Ł -> Ł
  • ł -> ł
  • Ń -> Ń
  • ń -> ń
  • Ņ -> Ņ
  • ņ -> ņ
  • Ň -> Ň
  • ň -> ň
  • ŋ -> ŋ
  • Ó -> Ó
  • ó -> ó
  • Ô -> Ô
  • ô -> ô
  • Ò -> Ò
  • ò -> ò
  • Ø -> Ø
  • ø -> ø
  • Õ -> Õ
  • õ -> õ
  • Ö -> Ö
  • ö -> ö
  • Ō -> Ō
  • ō -> ō
  • Ŏ -> Ŏ
  • ŏ -> ŏ
  • Ő -> Ő
  • ő -> ő
  • Œ -> Œ
  • œ -> œ
  • Ŕ -> Ŕ
  • ŕ -> ŕ
  • Ŗ -> Ŗ
  • ŗ -> ŗ
  • Ř -> Ř
  • ř -> ř
  • Ś -> Ś
  • ś -> ś
  • Ŝ -> Ŝ
  • ŝ -> ŝ
  • Ş -> Ş
  • ş -> ş
  • Š -> Š
  • š -> š
  • Ţ -> Ţ
  • ţ -> ţ
  • Ť -> Ť
  • ť -> ť
  • Ŧ -> Ŧ
  • ŧ -> ŧ
  • Ú -> Ú
  • ú -> ú
  • Û -> Û
  • û -> û
  • Ù -> Ù
  • ù -> ù
  • Ü -> Ü
  • ü -> ü
  • µ -> µ
  • Ũ -> Ũ
  • ũ -> ũ
  • Ū -> Ū
  • ū -> ū
  • Ŭ -> Ŭ
  • ŭ -> ŭ
  • Ů -> Ů
  • ů -> ů
  • Ű -> Ű
  • ű -> ű
  • Ų -> Ų
  • ų -> ų
  • Ŵ -> Ŵ
  • ŵ -> ŵ
  • Ŷ -> Ŷ
  • ŷ -> ŷ
  • Ÿ -> Ÿ
  • Ź -> Ź
  • ź -> ź
  • Ż -> Ż
  • ż -> ż
  • Ž -> Ž
  • ž -> ž
  • Ç -> Ç
  • ç -> ç
  • Ñ -> Ñ
  • ñ -> ñ
  • § -> §
  • ® -> ®
  • © -> ©
  • Ý -> Ý
  • ý -> ý
  • ÿ -> ÿ
  • Ÿ -> Ÿ
  • Þ -> Þ
  • þ -> þ
  • ß -> ß
  • £ -> £
  • ¥ -> ¥
  • € -> €
  • ¿ -> ¿
  • ¡ -> ¡
  • ™ -> ™
  • ℠ -> ℠

The idea behind this extension (and the reason why it won't replace any of the other HTML entities) is that if you have a file that contains the listed characters you can replace all of these at once just by running the command. This is very useful if you are working with localizable strings, and your source contains these special characters.

In a future release I intend to add an option to extend/override the character maps, and also provide an additional command to run only within a selection.

Requirements

Requires a recent version of Visual Studio Code running on NodeJS 7+ (async / await support).