HTML Code Cleaner Tools Extension for Visual Studio CodeThis is a Visual Studio Code extension for HTML file that helps to clean HTML code. OverviewThis extension contains 3 functions for the moment.
To have information about Know bugs/Issues, consult the section"Known Issues" at the bottom of this file.
How to useAll functions in this extension will apply to selected text (part of code). If no text is selected in the code, the function will use the whole content. HTML Code Cleaner - BeginOpen the code to update and execute this function to clean the text/code. The function will:
HTML Code Cleaner - EndBefore to save and publish the HTML code, execute this function to clean the code and set special coding to uniform the code. The function will:
HTML - Convert special charactersThis function is very simple, only have to execute the function and all characters will be converted. The pairs (character = HTML code) are stored in a JSON file in the Instruction on how to customize this file will be developped later. Configuration instructionsThere is the list of properties for this extension: Search Replace Begin and Search Replace EndThese settings are arrays that contain all Search and Replace regex apply when use respectively the "HTML Code Cleaner - Begin" and "HTML Code Cleaner - End" IMPORTANT: regex special characters must be escaped twice (\) instead of simple escaped (). The reason is that regular expression is stored in an JSON. This is an example of setting.
Domains To DeleteThis setting is an array of string that contain domain(s) to remove in link (A tag and IMG tag).
Include Sub Domains In DeletionThis setting is linked to the previous setting (Domains To Delete). It's a boolean value (true/false) to indicate if subdomain must be considered in the domain deletion. Example: If "Domains To Delete" contains "yourdomain.com" and the "Include Sub Domains in Deletion" is actiavted, then all these domains will be deleted: "subdomain.yourdomain.com", "www.yourdomain.com", "database.yourdomain.com", etc. The default value is TRUE. Text LanguagesThis setting is an array of language and code language. It's used to know the language of the text (not the coding language). This setting is used with the "HTML Code Cleaner - Begin" when empty SPAN are deleted. The script will removed all
**Convert French Numbers **This setting is to enable/disable the Conversion of French Numbers (default TRUE/enable). If you set to False, the conversion won't be executed. The conversion consists to replace "space" by "no blank space" in number and before symbol.
Example: the number: Clean URLThis setting is to enable/disable the Cleaning URL step in both Begin and End processes (default: TRUE/enable).
Trim SpacesThis setting is to enable/disable the Trim useless Spaces step in both Begin and End processes (default: TRUE/enable).
Known issuesHTML Code Cleaner - Begin & End
ReferenceList of Special characters: https://www.freeformatter.com/html-entities.html |