diff --git a/tests/word/text-autocorrection/as-you-type.js b/tests/word/text-autocorrection/as-you-type.js index 27f0c50a18..d9145778de 100644 --- a/tests/word/text-autocorrection/as-you-type.js +++ b/tests/word/text-autocorrection/as-you-type.js @@ -57,8 +57,6 @@ $(function () assert.strictEqual(AscTest.GetParagraphText(p), checkText + " ", text + " -> " + checkText); } - - QUnit.test("Test: capitalize first letter of the sentence", function (assert) { logicDocument.SetAutoCorrectFirstLetterOfSentences(true); diff --git a/word/Editor/Paragraph/Run/RunAutoCorrect.js b/word/Editor/Paragraph/Run/RunAutoCorrect.js index 66d9458664..8a37e56ff8 100644 --- a/word/Editor/Paragraph/Run/RunAutoCorrect.js +++ b/word/Editor/Paragraph/Run/RunAutoCorrect.js @@ -769,17 +769,13 @@ if (!this.AsYouType) return false; - - if (!oDocument.IsAutoCorrectFirstLetterOfSentences()) + + let isCellFistLetter = (oRunElementsBefore.IsEnd() && oParagraph.IsTableCellContent()); + + if ((isCellFistLetter && !oDocument.IsAutoCorrectFirstLetterOfCells()) + || (!isCellFistLetter && !oDocument.IsAutoCorrectFirstLetterOfSentences())) return false; - - if (oRunElementsBefore.IsEnd() - && oParagraph.IsTableCellContent() - && !oDocument.IsAutoCorrectFirstLetterOfCells()) - { - return false; - } - + if ("www" === sText || "http" === sText || "https" === sText) return false;