19 lines
728 B
Go
19 lines
728 B
Go
// Copyright (c) 2026 Storm Dragon
|
|
// Authors: Storm Dragon, Angus Kola
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
package atspi
|
|
|
|
// TextAttributesMisspelled recognizes provider spelling markers for native
|
|
// snapshots, character-attribute speech, and braille. Python Cthulhu also
|
|
// recognizes the error/spelling underline values used by some toolkits.
|
|
func TextAttributesMisspelled(values map[string]string) bool {
|
|
for _, key := range []string{"invalid", "invalid-spelling", "text-spelling", "spelling"} {
|
|
value := values[key]
|
|
if value == "spelling" || key != "invalid" && (value == "true" || value == "misspelled") {
|
|
return true
|
|
}
|
|
}
|
|
return values["underline"] == "error" || values["underline"] == "spelling"
|
|
}
|