Skip to content

Commit 7a59fd6

Browse files
committed
Fix casing
1 parent 861125e commit 7a59fd6

File tree

5 files changed

+32
-32
lines changed

5 files changed

+32
-32
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
'use strict'
22

3-
module.exports = toMDAST
3+
module.exports = toMdast
44

55
var minify = require('rehype-minify-whitespace')
66
var xtend = require('xtend')
77
var one = require('./lib/one')
88
var handlers = require('./lib/handlers')
99

10-
function toMDAST(tree, options) {
10+
function toMdast(tree, options) {
1111
var settings = options || {}
1212
var opts = {newlines: settings.newlines === true}
1313

@@ -43,8 +43,8 @@ function toMDAST(tree, options) {
4343
return augment(node, result)
4444
}
4545

46-
/* `right` is the finalized MDAST node,
47-
* created from `left`, a HAST node */
46+
/* `right` is the finalized mdast node,
47+
* created from `left`, a hast node */
4848
function augment(left, right) {
4949
if (left.position) {
5050
right.position = left.position

lib/util/wrap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ wrap.needed = needed
66

77
var phrasing = require('mdast-util-phrasing')
88

9-
/* Wrap all inline runs of MDAST content in `paragraph` nodes. */
9+
/* Wrap all inline runs of mdast content in `paragraph` nodes. */
1010
function wrap(nodes) {
1111
var result = []
1212
var length = nodes.length
@@ -48,7 +48,7 @@ function wrap(nodes) {
4848
}
4949
}
5050

51-
/* Check if there are non-inline MDAST nodes returned.
51+
/* Check if there are non-inline mdast nodes returned.
5252
* This is needed if a fragment is given, which could just be
5353
* a sentence, and doesn’t need a wrapper paragraph. */
5454
function needed(nodes) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "hast-util-to-mdast",
33
"version": "3.0.0",
4-
"description": "Transform HAST to MDAST",
4+
"description": "Transform hast to mdast",
55
"license": "MIT",
66
"keywords": [
77
"hast",

readme.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Downloads][downloads-badge]][downloads]
66
[![Chat][chat-badge]][chat]
77

8-
Transform [HAST][] (HTML) to [MDAST][] (markdown).
8+
Transform [hast][] (HTML) to [mdast][] (markdown).
99

1010
> **Note**: You probably want to use [rehype-remark][].
1111
@@ -32,15 +32,15 @@ var unified = require('unified')
3232
var parse = require('rehype-parse')
3333
var stringify = require('remark-stringify')
3434
var vfile = require('to-vfile')
35-
var toMDAST = require('hast-util-to-mdast')
35+
var toMdast = require('hast-util-to-mdast')
3636

3737
var file = vfile.readSync('example.html')
3838

3939
var hast = unified()
4040
.use(parse)
4141
.parse(file)
4242

43-
var mdast = toMDAST(hast)
43+
var mdast = toMdast(hast)
4444

4545
var doc = unified()
4646
.use(stringify)
@@ -57,9 +57,9 @@ Now, running `node example.js` yields:
5757

5858
## API
5959

60-
### `toMDAST(node[, options])`
60+
### `toMdast(node[, options])`
6161

62-
Transform the given [HAST][] tree to an [MDAST][] tree.
62+
Transform the given [hast][] tree to [mdast][].
6363

6464
##### Options
6565

@@ -71,8 +71,8 @@ Take a look at [`handlers/`][handlers] for examples.
7171
###### `options.document`
7272

7373
Whether the given tree is a complete document. If `document: true`,
74-
implicit paragraphs are added in the `root` node around inline MDAST nodes.
75-
Otherwise, inline MDAST nodes are wrapped when needed.
74+
implicit paragraphs are added in the `root` node around inline mdast nodes.
75+
Otherwise, inline mdast nodes are wrapped when needed.
7676

7777
###### `options.newlines`
7878

@@ -106,7 +106,7 @@ An implicit sentence.
106106

107107
###### Ignoring nodes
108108

109-
Some nodes are ignored and their content will not be present in MDAST.
109+
Some nodes are ignored and their content will not be present in mdast.
110110
To ignore custom elements, configure a handler for their tag-name or type that
111111
returns nothing.
112112
For example, to ignore `em` elements, pass `handlers: {'em': function () {}}`:
@@ -136,11 +136,11 @@ Yields:
136136
## Related
137137

138138
* [`hast-util-to-nlcst`](https://github.com/syntax-tree/hast-util-to-nlcst)
139-
— Transform HAST to NLCST
139+
— Transform hast to nlcst
140140
* [`mdast-util-to-hast`](https://github.com/syntax-tree/mdast-util-to-hast)
141-
— Transform MDAST to HAST
141+
— Transform mdast to hast
142142
* [`mdast-util-to-nlcst`](https://github.com/syntax-tree/mdast-util-to-nlcst)
143-
— Transform MDAST to NLCST
143+
— Transform mdast to nlcst
144144
* [`remark-rehype`](https://github.com/remarkjs/remark-rehype)
145145
— rehype support for remark
146146
* [`rehype-remark`](https://github.com/rehypejs/rehype-remark)

test/index.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,31 @@ var html = require('rehype-parse')
1313
var stringify = require('remark-stringify')
1414
var assert = require('mdast-util-assert')
1515
var remove = require('unist-util-remove-position')
16-
var toMDAST = require('..')
16+
var toMdast = require('..')
1717

1818
var fixtures = path.join(__dirname, 'fixtures')
1919

2020
test('core', function(t) {
2121
t.deepEqual(
22-
toMDAST(u('root', [h('strong', 'Alpha')])),
22+
toMdast(u('root', [h('strong', 'Alpha')])),
2323
u('root', [u('strong', [u('text', 'Alpha')])]),
24-
'should transform HAST to MDAST'
24+
'should transform hast to mdast'
2525
)
2626

2727
t.deepEqual(
28-
toMDAST(u('root', [u('unknown', 'text')])),
28+
toMdast(u('root', [u('unknown', 'text')])),
2929
u('root', [u('text', 'text')]),
3030
'should transform unknown texts to `text`'
3131
)
3232

3333
t.deepEqual(
34-
toMDAST(u('root', [u('unknown', [h('em')])])),
34+
toMdast(u('root', [u('unknown', [h('em')])])),
3535
u('root', [u('emphasis', [])]),
3636
'should unwrap unknown parents'
3737
)
3838

3939
t.deepEqual(
40-
toMDAST(u('root', [u('unknown')])),
40+
toMdast(u('root', [u('unknown')])),
4141
u('root', []),
4242
'should ignore unknown voids'
4343
)
@@ -48,7 +48,7 @@ test('core', function(t) {
4848
}
4949

5050
t.deepEqual(
51-
toMDAST({
51+
toMdast({
5252
type: 'root',
5353
children: [
5454
{
@@ -116,7 +116,7 @@ test('fixtures', function(t) {
116116
.use(function() {
117117
return transformer
118118
function transformer(tree) {
119-
return toMDAST(tree, config)
119+
return toMdast(tree, config)
120120
}
121121
})
122122
.use(stringify)
@@ -128,7 +128,7 @@ test('fixtures', function(t) {
128128

129129
st.doesNotThrow(function() {
130130
assert(tree)
131-
}, 'should produce valid MDAST nodes')
131+
}, 'should produce valid mdast nodes')
132132

133133
if (ignore) {
134134
st.end()
@@ -168,7 +168,7 @@ test('handlers option', function(t) {
168168
}
169169

170170
t.deepEqual(
171-
toMDAST(
171+
toMdast(
172172
{
173173
type: 'root',
174174
children: [
@@ -216,7 +216,7 @@ test('document option', function(t) {
216216
])
217217

218218
t.deepEqual(
219-
toMDAST(tree),
219+
toMdast(tree),
220220
u('root', [
221221
u('strong', [u('text', 'Importance')]),
222222
u('text', ' and '),
@@ -227,7 +227,7 @@ test('document option', function(t) {
227227
)
228228

229229
t.deepEqual(
230-
toMDAST(tree, {document: true}),
230+
toMdast(tree, {document: true}),
231231
u('root', [
232232
u('paragraph', [
233233
u('strong', [u('text', 'Importance')]),
@@ -244,7 +244,7 @@ test('document option', function(t) {
244244

245245
test('newlines option', function(t) {
246246
t.deepEqual(
247-
toMDAST({
247+
toMdast({
248248
type: 'root',
249249
children: [
250250
{
@@ -278,7 +278,7 @@ test('newlines option', function(t) {
278278
)
279279

280280
t.deepEqual(
281-
toMDAST(
281+
toMdast(
282282
{
283283
type: 'root',
284284
children: [

0 commit comments

Comments
 (0)