Skip to content

Commit

Permalink
Add double and single guillemet (#20)
Browse files Browse the repository at this point in the history
* add double and single guillemet

* update version

* Update package.json

---------

Co-authored-by: azu <[email protected]>
  • Loading branch information
aborazmeh and azu authored Jul 8, 2024
1 parent 95ef2df commit 1329fb2
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
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
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
}
]
}
]
});

0 comments on commit 1329fb2

Please sign in to comment.