Skip to content

Commit 1329fb2

Browse files
aborazmehazu
andauthored
Add double and single guillemet (#20)
* add double and single guillemet * update version * Update package.json --------- Co-authored-by: azu <azu@users.noreply.github.com>
1 parent 95ef2df commit 1329fb2

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ textlint rule that check unmatched pairs like `(` and `]`
1515
- 角括弧[]: `` and ``
1616
- 重角括弧〚〛: `` and ``
1717
- 隅付き括弧【】: `` and ``
18+
- double guillemet: `«` and `»`
19+
- single guillemet: `` and ``
1820

1921
## Examples
2022

src/parser/PairMaker.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ const PAIR_MARKS = [
6666
key: "隅付き括弧【】",
6767
start: `【`,
6868
end: `】`
69+
},
70+
{
71+
key: "double guillemet «»",
72+
start: "«",
73+
end: "»"
74+
},
75+
{
76+
key: "single guillemet ‹›",
77+
start: "‹",
78+
end: "›"
6979
}
7080
];
7181

test/textlint-rule-no-unmatched-pair-test.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ tester.run("textlint-rule-no-unmatched-pair", rule, {
3737
// GitHub Flavored Markdown
3838
// https://github.com/orgs/community/discussions/16925
3939
`> [!NOTE]
40-
> some content`
40+
> some content`,
41+
`Paul a dit : « Je viendrai demain » .`,
42+
`Elle a écrit: « L’article est intitulé ‹ La technologie aujourd’hui › » .`
4143
],
4244
invalid: [
4345
{
@@ -95,6 +97,24 @@ This pair mark is called double quote.`
9597
column: 105
9698
}
9799
]
100+
},
101+
{
102+
text: `Paul a dit : « Je viendrai demain.`,
103+
errors: [
104+
{
105+
line: 1,
106+
column: 15
107+
}
108+
]
109+
},
110+
{
111+
text: `Elle a écrit: « L’article est intitulé ‹ La technologie aujourd’hui » .`,
112+
errors: [
113+
{
114+
line: 1,
115+
column: 41
116+
}
117+
]
98118
}
99119
]
100120
});

0 commit comments

Comments
 (0)