Skip to content

splitAST does not split sentences within emphasis #24

@kimburgess

Description

@kimburgess

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.**

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions