Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/remark-lint/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@node-core/remark-lint",
"type": "module",
"version": "1.2.0",
"version": "1.2.1",
"exports": {
".": "./src/index.mjs",
"./api": "./src/api.mjs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ const testCases = [
'Type reference should be separated by "|", without spaces; saw "{string | boolean}"',
],
},
{
name: 'newline, multiple references',
input: 'Psst, are you a {string|\nboolean}',
expected: [],
},
{
name: 'invalid references',
input: 'This is {invalid}.',
Expand Down
4 changes: 2 additions & 2 deletions packages/remark-lint/src/rules/invalid-type-reference.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import createQueries from '@nodejs/doc-kit/src/utils/queries/index.mjs';
import { lintRule } from 'unified-lint-rule';
import { visit } from 'unist-util-visit';

const MATCH_RE = /\s\||\|\s/g;
const REPLACE_RE = /\s*\|\s*/g;
const MATCH_RE = /\s\||\| /g;
const REPLACE_RE = /\s*\| */g;

/**
* Ensures that all type references are valid
Expand Down
Loading