
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Typeset is an HTML pre-processor for web typography which provides typographic features used traditionally in fine printing which remain unavailable to browser layout engines. Typeset's processing brings the following to your webpages:
Typeset does not require any client-side JavaScript and uses less than a kilobyte of CSS. Processed HTML & CSS works in Internet Explorer 5 and without any CSS. Typeset can be used manually or as a plugin for Grunt and gulp.
$ npm i typeset
const typeset = require('typeset');
let html = '<p>"Hello," said the fox.</p>';
let output = typeset(html);
Then tweak the CSS to match the metrics of your font and include it on your page.
/*
Small Capitals
https://en.wikipedia.org/wiki/Small_caps
*/
.small-caps {font-variant: small-caps;}
/*
Optical margin alignment for particular letters
https://en.wikipedia.org/wiki/Optical_margin_alignment
*/
.pull-T, .pull-V, .pull-W, .pull-Y {margin-left: -0.07em}
.push-T, .push-V, .push-W, .push-Y {margin-right: 0.07em}
.pull-O, .pull-C, .pull-o, .pull-c {margin-left: -0.04em}
.push-O, .push-C, .push-o, .push-c {margin-right: 0.04em}
.pull-A {margin-left: -0.03em}
.push-A {margin-right: 0.03em}
/*
Quotation mark
https://en.wikipedia.org/wiki/Quotation_mark
*/
/* Single quotation marks (') */
.pull-single{margin-left:-.27em}
.push-single{margin-right:.27em}
.pull-double, .push-double,
.pull-single, .push-single {display: inline-block}
/* Double quotation marks (") */
.pull-double{margin-left:-.46em}
.push-double{margin-right:.46em}
You can pass an options object to influence how your HTML is typeset:
const options = {
ignore: '.skip, #anything, .which-matches', // string of CSS selector(s) to ignore
only: '#only-typeset, .these-elements', // string of CSS selector(s) to exclusively apply typeset to
disable: ['hyphenate'] // array of typeset feature(s) to disable
};
The following features may be disabled:
hyphenate
hangingPunctuation
ligatures
punctuation
quotes
smallCaps
spaces
$ npm i -g typeset
Usage: typeset-js [options] [<infile> [<outfile>]]
Options:
-h, --help output usage information
-V, --version output the version number
-i, --ignore string of CSS selector(s) to ignore
-O, --only string of CSS selector(s) to exclusively apply typeset to
--disable, string of typeset feature(s) to disable, separated by commas
Compile a file and print it to stdout:
$ typeset-js inputFile.html
To create an output file, just add a second argument:
$ typeset-js inputFile.html outputFile.html
Use the --ignore
option to ignore specific CSS selectors:
$ typeset-js inputFile.html outputFile.html --ignore ".some-class, h3"
Use the --disable
option to disable typeset features:
$ typeset-js inputFile.html outputFile.html --disable "hyphenate,ligatures"
CLI redirections:
$ cat index.html | typeset-js > outputFile.html
If you don't find the answer to your problem in our docs, or have a suggestion for improvements, submit your question here.
This software is dedicated to the public domain and licensed under Creative Commons Zero. See the LICENSE file for details.
FAQs
Typesetting for the web
We found that typeset demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.