Skip to content

Releases: textlint/textlint-util-to-string

v3.3.4

25 Nov 05:05
@azu azu
99f54ce
Compare
Choose a tag to compare

What's Changed

Bug Fixes

  • fix unist node handling by @azu in #23

Full Changelog: v3.3.3...v3.3.4

v3.3.3

25 Nov 04:36
@azu azu
34f9728
Compare
Choose a tag to compare

What's Changed

Refactoring

  • fix(deps): update @textlint/ast-node-types and refactor types by @azu in #21

Full Changelog: v3.3.2...v3.3.3

v3.3.2

13 Feb 12:16
@azu azu
c643fc5
Compare
Choose a tag to compare

What's Changed

Bug Fixes

  • Improve sentence-splliter integration by @azu in #20

Full Changelog: v3.3.0...v3.3.2

v3.3.0

11 Feb 12:14
@azu azu
59ba571
Compare
Choose a tag to compare

What's Changed

Features

  • feat: add replacer option by @azu in #18

options.replacer is a function that takes a node and commands like maskValue or emptyValue.
If you want to modify the value of the node, return command function calls.

// "This is a `code`."
const source = new StringSource(paragraphNode, {
    replacer({ node, maskValue }) {
        if (node.type === "Code") {
            return maskValue("_"); // code => ____
        }
    }
});
console.log(source.toString()); // => "This is a ____."
  • maskValue(character: string): mask the value of the node with the given character.
  • emptyValue(): replace the value of the node with an empty string.
const AST = parse("This is `TEST`.");
const source = new StringSource(AST, {
    replacer({ node, emptyValue }) {
        if (node.type === "Code") {
            return emptyValue();
        }
    }
});
assert.strictEqual(source.toString(), "This is .");

Examples:

Full Changelog: v3.2.0...v3.3.0

v3.2.0

29 Jan 13:12
@azu azu
6656fc6
Compare
Choose a tag to compare

What's Changed

  • refactor: update dependencies by @azu in #16

Full Changelog: v3.1.1...v3.2.0

v3.1.1

25 Jul 16:07
@azu azu
Compare
Choose a tag to compare

Bug Fixes

v3.1.0

25 Jul 06:39
@azu azu
Compare
Choose a tag to compare

Features

  • use microbundle for distribution (#15) (3df1fc2)

3.1.0 has an issue - Missing some files.
It will be fixed in 3.1.1

3.0.0

16 Sep 13:41
@azu azu
Compare
Choose a tag to compare

Features

  • src: Support Html node #11

Code Refactoring

  • src: Convert to TypeScript (d12f33f)

BREAKING CHANGES

  • src: export { StringSource } instead of export default

You need to change import statement.

- import StringSource from "textlint-util-to-string"
+ import { StringSource }  from "textlint-util-to-string"

2.1.1

10 Oct 11:22
@azu azu
Compare
Choose a tag to compare

Bug Fixes

  • link's title should not to be string (#7) (5f9ac6b)

2.1.0

28 May 05:45
@azu azu
Compare
Choose a tag to compare

Features