Skip to content

draftail_curlify.js places closing quote at the beginning of a phrase #16

Description

@paulschreiber

Description

When adding quotes to text, draftail_curlify.js places a closing quote (instead of an opening quote) at the beginning of a phrase.

Steps to reproduce

  1. Add a full width text block
  2. Type or paste in a few words
The quick brown fox jumps over the lazy dog.
  1. Place the cursor before "brown"
  2. Type a double quote (")
  3. Place the cursor after "fox"
  4. Type a double quote (")

Expected result

The quick “brown fox” jumps over the lazy dog.

U+201C and U+201D

Actual result

The quick ”brown fox” jumps over the lazy dog.

U+201D and U+201D

Related code

This code block is triggered and lastCharacter !== ' ' evaluates to true

					const lastCharacter = textContent[textLength - 1]
					if (lastCharacter !== ' ') {
						replaceCharacter(str === '"' ? DQUOTE_END : SQUOTE_END)
					} else {
						replaceCharacter(str === '"' ? DQUOTE_START : SQUOTE_START)
					}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions