Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add double and single guillemet #20

Merged
merged 3 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ textlint rule that check unmatched pairs like `(` and `]`
- 角括弧[]: `[` and `]`
- 重角括弧〚〛: `〚` and `〛`
- 隅付き括弧【】: `【` and `】`
- double guillemet: `«` and `»`
- single guillemet: `‹` and `›`

## Examples

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@textlint-rule/textlint-rule-no-unmatched-pair",
"version": "2.0.2",
"version": "2.0.3",
azu marked this conversation as resolved.
Show resolved Hide resolved
"description": "textlint rule that check unmatched pairs like \"(\" and \")\"",
"keywords": [
"textlintrule"
Expand Down
10 changes: 10 additions & 0 deletions src/parser/PairMaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ const PAIR_MARKS = [
key: "隅付き括弧【】",
start: `【`,
end: `】`
},
{
key: "double guillemet «»",
start: "«",
end: "»"
},
{
key: "single guillemet ‹›",
start: "‹",
end: "›"
}
];

Expand Down
22 changes: 21 additions & 1 deletion test/textlint-rule-no-unmatched-pair-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ tester.run("textlint-rule-no-unmatched-pair", rule, {
// GitHub Flavored Markdown
// https://github.com/orgs/community/discussions/16925
`> [!NOTE]
> some content`
> some content`,
`Paul a dit : « Je viendrai demain » .`,
`Elle a écrit: « L’article est intitulé ‹ La technologie aujourd’hui › » .`
],
invalid: [
{
Expand Down Expand Up @@ -95,6 +97,24 @@ This pair mark is called double quote.`
column: 105
}
]
},
{
text: `Paul a dit : « Je viendrai demain.`,
errors: [
{
line: 1,
column: 15
}
]
},
{
text: `Elle a écrit: « L’article est intitulé ‹ La technologie aujourd’hui » .`,
errors: [
{
line: 1,
column: 41
}
]
}
]
});
Loading