-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
I created this issue here because I am not sure if the responsibility for this issue lies with the sentence-splitter.
As-Is
Lint the following Markdown text:
- これは改行を含む箇条書きです。(このように、括弧の間に改行と
[ハイパーリンク](https://example.com/)が含まれていても正しく判定されます。)The rule retrieves the Paragraph node as follows:
{
type: 'Paragraph',
children: [
{
type: 'Str',
value: 'これは改行を含む箇条書きです。(このように、括弧の間に改行と\n',
loc: [Object],
range: [Array],
raw: 'これは改行を含む箇条書きです。(このように、括弧の間に改行と\n'
},
{
type: 'Link',
title: null,
url: 'https://example.com/',
children: [Array],
loc: [Object],
range: [Array],
raw: '[ハイパーリンク](https://example.com/)'
},
{
type: 'Str',
value: 'が含まれていても正しく判定されます。)',
loc: [Object],
range: [Array],
raw: 'が含まれていても正しく判定されます。)'
}
],
loc: { start: { line: 1, column: 2 }, end: { line: 2, column: 52 } },
range: [ 2, 85 ],
raw: 'これは改行を含む箇条書きです。(このように、括弧の間に改行と\n' +
' [ハイパーリンク](https://example.com/)が含まれていても正しく判定されます。)'
}This node is transformed by the splitAST of the sentence-splitter as follows:
{
type: 'Paragraph',
children: [
{
type: 'Sentence',
raw: 'これは改行を含む箇条書きです。',
loc: [Object],
range: [Array],
children: [Array],
contexts: []
},
{
type: 'Sentence',
raw: '(このように、括弧の間に改行と\n ',
loc: [Object],
range: [Array],
children: [Array],
contexts: []
}
],
loc: { start: { line: 1, column: 2 }, end: { line: 2, column: 52 } },
range: [ 2, 85 ],
raw: 'これは改行を含む箇条書きです。(このように、括弧の間に改行と\n' +
' [ハイパーリンク](https://example.com/)が含まれていても正しく判定されます。)'
}To-Be
I think the sentence should be retrieved up to the last string.
{
type: 'Paragraph',
children: [
{
type: 'Sentence',
raw: 'これは改行を含む箇条書きです。',
loc: [Object],
range: [Array],
children: [Array],
contexts: []
},
{
type: 'Sentence',
raw: '(このように、括弧の間に改行と\n [ハイパーリンク](https://example.com/)が含まれていても正しく判定されます。)',
loc: [Object],
range: [Array],
children: [Array],
contexts: [Array]
}
],
loc: { start: { line: 1, column: 2 }, end: { line: 2, column: 52 } },
range: [ 2, 85 ],
raw: 'これは改行を含む箇条書きです。(このように、括弧の間に改行と\n' +
' a[ハイパーリンク](https://example.com/)が含まれていても正しく判定されます。)'
}Metadata
Metadata
Assignees
Labels
No labels