Skip to content

Commit 0da6dbc

Browse files
committed
Refactor to shout less
1 parent ac2eed3 commit 0da6dbc

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

lib/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ var voids = require('html-void-elements')
66
var omission = require('./omission')
77
var one = require('./one')
88

9-
module.exports = toHTML
9+
module.exports = toHtml
1010

1111
var quotationMark = '"'
1212
var apostrophe = "'"
1313

14-
// Stringify the given HAST node.
15-
function toHTML(node, options) {
14+
// Stringify the given hast node.
15+
function toHtml(node, options) {
1616
var settings = options || {}
1717
var quote = settings.quote || quotationMark
1818
var alternative = quote === quotationMark ? apostrophe : quotationMark

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "hast-util-to-html",
33
"version": "5.0.0",
4-
"description": "Transform HAST to HTML",
4+
"description": "Transform hast to HTML",
55
"license": "MIT",
66
"keywords": [
77
"hast",
@@ -44,8 +44,8 @@
4444
},
4545
"scripts": {
4646
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix",
47-
"build-bundle": "browserify . -s hastUtilToHTML > hast-util-to-html.js",
48-
"build-mangle": "browserify . -s hastUtilToHTML -p tinyify > hast-util-to-html.min.js",
47+
"build-bundle": "browserify . -s hastUtilToHtml > hast-util-to-html.js",
48+
"build-mangle": "browserify . -s hastUtilToHtml -p tinyify > hast-util-to-html.min.js",
4949
"build": "npm run build-bundle && npm run build-mangle",
5050
"test-api": "node test",
5151
"test-coverage": "nyc --reporter lcov tape test/index.js",

readme.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ npm install hast-util-to-html
2222

2323
```js
2424
var h = require('hastscript')
25-
var toHTML = require('hast-util-to-html')
25+
var toHtml = require('hast-util-to-html')
2626

2727
var tree = h('.alpha', [
2828
'bravo ',
@@ -31,7 +31,7 @@ var tree = h('.alpha', [
3131
h('a.echo', {download: true}, 'foxtrot')
3232
])
3333

34-
console.log(toHTML(tree))
34+
console.log(toHtml(tree))
3535
```
3636

3737
Yields:
@@ -42,7 +42,7 @@ Yields:
4242

4343
## API
4444

45-
### `toHTML(tree[, options])`
45+
### `toHtml(tree[, options])`
4646

4747
Stringify the given [**hast**][hast] [*tree*][tree].
4848

@@ -51,14 +51,14 @@ Stringify the given [**hast**][hast] [*tree*][tree].
5151
Whether the [*root*][root] of the [*tree*][tree] is in the `'html'` or `'svg'`
5252
space (enum, `'svg'` or `'html'`, default: `'html'`).
5353

54-
If an `svg` element is found in the HTML space, `toHTML` automatically switches
54+
If an `svg` element is found in the HTML space, `toHtml` automatically switches
5555
to the SVG space when entering the element, and switches back when exiting.
5656

5757
###### `options.entities`
5858

5959
Configuration for [`stringify-entities`][stringify-entities] (`Object`, default:
6060
`{}`).
61-
Do not use `escapeOnly`, `attribute`, or `subset` (`toHTML` already passes
61+
Do not use `escapeOnly`, `attribute`, or `subset` (`toHtml` already passes
6262
those, so they won’t work).
6363
However, `useNamedReferences`, `useShortestReferences`, and
6464
`omitOptionalSemicolons` are all fine.
@@ -170,7 +170,7 @@ When falsey, encodes `raw` nodes (`boolean`, default: `false`).
170170
## Related
171171

172172
* [`hast-util-sanitize`][hast-util-sanitize]
173-
— Sanitize HAST nodes
173+
— Sanitize hast nodes
174174
* [`rehype-stringify`](https://github.com/wooorm/rehype/tree/master/packages/rehype-stringify)
175175
— Wrapper around this project for [**rehype**](https://github.com/wooorm/rehype)
176176

test/core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var test = require('tape')
44
var u = require('unist-builder')
55
var to = require('..')
66

7-
test('toHTML()', function(t) {
7+
test('toHtml()', function(t) {
88
t.throws(
99
function() {
1010
to(true)

0 commit comments

Comments
 (0)