You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Preprocesses an attributed string's attachments for insertion in the storage.
@@ -254,34 +253,33 @@ open class TextStorage: NSTextStorage {
254
253
return processedString
255
254
}
256
255
257
-
/// Preprocesses an attributed string that is missing a `markHtmlRepresentation` attribute for insertion in the storage, this reuses the same behavior as preprocessHeadingsForInsertion
256
+
/// Preprocesses an attributed string that is missing a `markHtmlRepresentation` attribute for insertion in the storage.
257
+
/// This method ensures that the `markHtmlRepresentation` attribute, if present in the current text storage,
258
+
/// is applied to the new attributed string being inserted. This is particularly useful for maintaining
259
+
/// mark formatting in scenarios like autocorrection or predictive text input.
258
260
///
259
-
/// - Important: This method adds the `markHtmlRepresentation` attribute if it determines the string should contain it.
260
-
/// This works around a problem where autocorrected text didn't contain the attribute. This may change in future versions.
261
+
/// - Important: This method adds the `markHtmlRepresentation` attribute to the new string if it's determined
262
+
/// that the string should contain it, based on existing attributes in the text storage.
263
+
/// This helps to overcome issues where autocorrected text does not carry over the `markHtmlRepresentation` attribute.
261
264
///
262
265
/// - Parameters:
263
-
/// - attributedString: the string we need to preprocess.
266
+
/// - attributedString: The new string to be inserted.
267
+
/// - range: The range in the current text storage where the new string is to be inserted. This is used to determine
268
+
/// if `markHtmlRepresentation` should be applied to the new string.
264
269
///
265
-
/// - Returns: the preprocessed string.
270
+
/// - Returns: The preprocessed attributed string with `markHtmlRepresentation` applied if necessary.
0 commit comments