HTML helper functions
This module uses yarn to manage dependencies and run scripts for development.
To install as an application dependency:
$ yarn add util.html
To build the app and run all tests:
$ yarn run all
This module contains custom HTML manipulation functions.
events
- an array of possible events that can be used in javascript for event listeners. The list was taken from MDN.
- getFontWidth - Reads the current font style information from the body of the current document.
- getTextWidth - Takes an input string and font settings and computes the pixel width of the string.
- newlineToBreak - takes a string with newline characters and replaces them with
<br />
- translateHTML - converts special HTML characters to their single character equivalents (such as
"e;
to"
). - trimHTML - special trim function to remove spaces from the front/end of an HTML string.