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

splitAST does not split sentences within emphasis #24

Open
kimburgess opened this issue May 19, 2021 · 0 comments
Open

splitAST does not split sentences within emphasis #24

kimburgess opened this issue May 19, 2021 · 0 comments
Labels
Status: Proposal Request for comments Type: Feature New Feature

Comments

@kimburgess
Copy link

When passing:

{
  type: 'Paragraph',
  children: [
    {
      type: 'Strong',
      children: [Array],
      loc: [Object],
      range: [Array],
      raw: '**This emphasis has more than one sentence. It has two lines.**'
    }
  ],
  loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 63 } },
  range: [ 0, 63 ],
  raw: '**This emphasis has more than one sentence. It has two lines.**'
}

The following is returned:

{
  type: 'Paragraph',
  children: [
    {
      type: 'Sentence',
      raw: '**This emphasis has more than one sentence. It has two lines.**',
      loc: [Object],
      range: [Array],
      children: [Array]
    }
  ],
  loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 63 } },
  range: [ 0, 63 ],
  raw: '**This emphasis has more than one sentence. It has two lines.**'
}

Note that this can be represented across multiple lines, without altering rendered output:

**This emphasis has more than one sentence. It has two lines.**'

is equivalent to

**This emphasis has more than one sentence.
It has two lines.**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Proposal Request for comments Type: Feature New Feature
Projects
None yet
Development

No branches or pull requests

2 participants