question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Spell check deletes words if there's color formatting on the line

See original GitHub issue

QUICK FIX: https://github.com/quilljs/quill/issues/2096#issuecomment-399576957

Steps for Reproduction

  1. Visit quilljs.com and go to the third example where you can set a font color
  2. Create a colored sentence with a typo, like “I love makig bugs”
  3. Right click “makig” to correct the spelling

Expected behavior: The spelling should be corrected just like regular, non-formatted text

Actual behavior: Characters are deleted. Sometimes it’s just the word, sometimes it’s everything before it

Platforms: macOS High Sierra. Chrome and Safari (notably, not Firefox)

Version: 1.3.6

Related:

The issue doesn’t happen when you use classes instead of inline styles, which makes me think it’s some kind of issue with normalized, rgb() values and quill uses hex. I tried forcing the Delta to use rgb() but it didn’t help.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:15
  • Comments:14

github_iconTop GitHub Comments

19reactions
chearoncommented, Jun 22, 2018

This seems to do everything correctly, I’ll update it with any fixes:

const Inline = Quill.import('blots/inline');

class CustomColor extends Inline {
  constructor(domNode, value) {
    super(domNode, value);

    // Map <font> properties
    domNode.style.color = domNode.color;

    const span = this.replaceWith(new Inline(Inline.create()));

    span.children.forEach(child => {
      if (child.attributes) child.attributes.copy(span);
      if (child.unwrap) child.unwrap();
    });

    this.remove();

    return span;
  }
}

CustomColor.blotName = "customColor";
CustomColor.tagName = "FONT";

Quill.register(CustomColor, true);
7reactions
LeeMustachecommented, Dec 22, 2020

It’s still a problem. I think it’s worth fixing instead of relying on programmers to create workarounds. Spell correcting is a pretty basic and commonly used feature.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Red Squiggly Underlines When Words are Not Spelled ...
Here's one reason: The spelling is based on the language assigned to the text, and if you choose the wrong language, InDesign can't...
Read more >
How to Remove Red Wavy Underlines in Word Document 2019
Microsoft Word turns on Spell check and Grammar check by default. The red wavy underlines just mean flagged spelling errors and the green ......
Read more >
Blue wavy lines that appear under text indicate Format ...
Describes the fact that blue wavy lines that appear under text indicate that the Format Consistency Checker is working in Word.
Read more >
Video: Spell check your email - Microsoft Support
And you can change how they work and what they check for, if you like. Want more. Change the message format to HTML,...
Read more >
Spell-check and language dictionaries in InDesign
Misspelled or unknown words, words typed twice in a row (such as “the the”), and words with possible capitalization errors are highlighted. In ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found