Giter Site home page Giter Site logo

enriquein / htmlentity-replacer Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 5.0 106 KB

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

License: Apache License 2.0

JavaScript 100.00%
accented-characters html-entities special-characters vscode-extension

htmlentity-replacer's Introduction

HTML accented character converter

VSCode extension for quick replacements of accented characters into html entities. Useful if you are working with localizable strings that contain special characters and you wish to replace them with their corresponding HTML entities.

Demo

Demo

Features

This extension adds a command to Visual Studio Code to replace special characters into html entities. The command will appear in your Command Palette as Replace special characters with Html entities. It includes 204 common special character replacements. For example, here's a partial list of some of them:

  • Á -> Á
  • é -> é
  • í -> í
  • Ó -> Ó
  • ø -> ø
  • ù -> ù
  • Ü -> Ü
  • ü -> ü
  • µ -> µ
  • Ç -> Ç
  • ¿ -> ¿
  • ¡ -> ¡
  • ™ -> ™
  • ℠ -> ℠

Note that it does not include replacing of " (") because of how common they are under some scenarios when dealing with localizable strings within files and source code.

From version 2.0 the extension supports adding your own replacements, and even overriding existing ones. To do this, you can edit the settings.json file and add an object with property name of htmlentityreplacer.overrides. For example, if you wanted to add a replacement for ", and also override the built-in replacement for á:

{
    // other user scope vscode settings... ,
    "htmlentityreplacer.overrides": {
        "\"": """,
        "á": "á"
    }
}

This would also allow you to "disable" some replacements if this is necessary for your use case. To do this, you can simply add a replacement where the value being replaced is the same as the original. It's easier to explain with code. For example, to disable replacing ¿:

{
    // other user scope vscode settings... ,
    "htmlentityreplacer.overrides": {
        "¿": "¿"
    }
}

Thanks

Many thanks to @developerG27, @cadukich, @pszxzsd, and @vgdsouza for their contributions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.