This commit is contained in:
5
node_modules/hast-util-to-html/lib/omission/util/comment.js
generated
vendored
Normal file
5
node_modules/hast-util-to-html/lib/omission/util/comment.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
var convert = require('unist-util-is/convert')
|
||||
|
||||
module.exports = convert('comment')
|
||||
27
node_modules/hast-util-to-html/lib/omission/util/siblings.js
generated
vendored
Normal file
27
node_modules/hast-util-to-html/lib/omission/util/siblings.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
'use strict'
|
||||
|
||||
var whiteSpace = require('hast-util-whitespace')
|
||||
|
||||
exports.before = siblings(-1)
|
||||
exports.after = siblings(1)
|
||||
|
||||
// Factory to check siblings in a direction.
|
||||
function siblings(increment) {
|
||||
return sibling
|
||||
|
||||
// Find applicable siblings in a direction.
|
||||
function sibling(parent, index, includeWhiteSpace) {
|
||||
var siblings = parent && parent.children
|
||||
var offset = index + increment
|
||||
var next = siblings && siblings[offset]
|
||||
|
||||
if (!includeWhiteSpace) {
|
||||
while (next && whiteSpace(next)) {
|
||||
offset += increment
|
||||
next = siblings[offset]
|
||||
}
|
||||
}
|
||||
|
||||
return next
|
||||
}
|
||||
}
|
||||
13
node_modules/hast-util-to-html/lib/omission/util/white-space-start.js
generated
vendored
Normal file
13
node_modules/hast-util-to-html/lib/omission/util/white-space-start.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
'use strict'
|
||||
|
||||
var convert = require('unist-util-is/convert')
|
||||
var whiteSpace = require('hast-util-whitespace')
|
||||
|
||||
module.exports = whiteSpaceStart
|
||||
|
||||
var isText = convert('text')
|
||||
|
||||
// Check if `node` starts with white-space.
|
||||
function whiteSpaceStart(node) {
|
||||
return isText(node) && whiteSpace(node.value.charAt(0))
|
||||
}
|
||||
Reference in New Issue
Block a user