Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
micromark-factory-space
Advanced tools
micromark factory to parse markdown space (found in lots of places)
The micromark-factory-space package is a utility for handling spaces in the micromark ecosystem, which is a tool for parsing and compiling markdown. It provides functions to handle spaces, tabs, and line endings in markdown documents.
Handling spaces
This feature allows you to handle spaces in markdown documents. The factorySpace function is used to create a tokenizer that processes spaces.
const { factorySpace } = require('micromark-factory-space');
const tokenizer = {
tokenize: function (effects, ok, nok) {
return factorySpace(effects, ok, 'space');
}
};
Handling tabs
This feature allows you to handle tabs in markdown documents. The factorySpace function is used to create a tokenizer that processes tabs.
const { factorySpace } = require('micromark-factory-space');
const tokenizer = {
tokenize: function (effects, ok, nok) {
return factorySpace(effects, ok, 'tab');
}
};
Handling line endings
This feature allows you to handle line endings in markdown documents. The factorySpace function is used to create a tokenizer that processes line endings.
const { factorySpace } = require('micromark-factory-space');
const tokenizer = {
tokenize: function (effects, ok, nok) {
return factorySpace(effects, ok, 'lineEnding');
}
};
Micromark is a comprehensive markdown parser that includes various utilities for handling markdown syntax, including spaces, tabs, and line endings. It is more feature-rich compared to micromark-factory-space, which focuses specifically on space handling.
Remark is a markdown processor built on the unified framework. It provides extensive plugins and utilities for parsing, transforming, and compiling markdown. While it offers broader functionality, it can be more complex to use compared to the focused micromark-factory-space.
Markdown-it is a fast and flexible markdown parser that supports plugins for extended functionality. It provides similar capabilities for handling spaces, tabs, and line endings but is designed to be more extensible and customizable.
micromark factory to parse markdown space (found in lots of places).
This package exposes states to parse spaces and/or tabs.
This package is useful when you are making your own micromark extensions.
This package is ESM only. In Node.js (version 16+), install with npm:
npm install micromark-factory-space
In Deno with esm.sh
:
import {factorySpace} from 'https://esm.sh/micromark-factory-space@1'
In browsers with esm.sh
:
<script type="module">
import {factorySpace} from 'https://esm.sh/micromark-factory-space@1?bundle'
</script>
import {factorySpace} from 'micromark-factory-space'
import {codes, types} from 'micromark-util-symbol'
// A micromark tokenizer that uses the factory:
/**
* @this {TokenizeContext}
* Context.
* @type {Tokenizer}
*/
function tokenizeCodeFenced(effects, ok, nok) {
return start
// …
/** @type {State} */
function info(code) {
if (code === codes.eof || markdownLineEndingOrSpace(code)) {
effects.exit(types.chunkString)
effects.exit(types.codeFencedFenceInfo)
return factorySpace(effects, infoAfter, types.whitespace)(code)
}
if (code === codes.graveAccent && code === marker) return nok(code)
effects.consume(code)
return info
}
// …
}
This module exports the identifier factorySpace
.
There is no default export.
factorySpace(…)
Parse spaces and tabs.
There is no nok
parameter:
ok
will be switched to whether spaces were found or notmarkdownSpace(code)
right
before using factorySpace
Where ␉
represents a tab (plus how much it expands) and ␠
represents a
single space.
␉
␠␠␠␠
␉␠
effects
(Effects
)
— contextok
(State
)
— state switched to when successfultype
(string
)
— type (' \t'
)max
(number
, default: Infinity
)
— max (exclusive)Start state (State
).
This package is fully typed with TypeScript. It exports no additional types.
Projects maintained by the unified collective are compatible with maintained versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
micromark-factory-space@2
, compatible with Node.js 16.
This package works with micromark@3
.
This package is safe.
See security.md
in micromark/.github
for how to
submit a security report.
See contributing.md
in micromark/.github
for ways
to get started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.
FAQs
micromark factory to parse markdown space (found in lots of places)
The npm package micromark-factory-space receives a total of 0 weekly downloads. As such, micromark-factory-space popularity was classified as not popular.
We found that micromark-factory-space demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.