Created attachment 148347 [details] Syntax color example In a user defined Kate .xml syntax file, an item containing a space does not process correctly, for example <item>for binary append</item> When the weakDeliminator attribute is used in the .xml file to instruct the parser to ignore space as a delimiter in the <item> , as here, <keywords casesensitive="0" weakDeliminator="' '" /> the above <item> text in a document, for example, open file for binary append as f1 is not properly colored if preceded or succeeded by a space. All syntax coloring in the document for items is lost if the <item> is delimited by space. STEPS TO REPRODUCE 1. Add <item>for binary append</item> to a Kate user-defined syntax file list. 2. Open Kate, add open file for binary append as f1 to an appropriate document. 3. OBSERVED RESULT for binary append is not colored EXPECTED RESULT for binary append should be colored SOFTWARE/OS VERSIONS Windows: 10 macOS: Linux/KDE Plasma: Fedora 36 beta (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
The way keyword works is to take all the characters that are not delimiters and then search for a keyword. With > for binary append <, the string searched will be " for binary append " which has no match since there are extra spaces. <keyword> is absolutely not made to work with delimiters present in items. You can use <WordDetect> which only checks for delimiters at the beginning and end. In this case, you don't need to put any more spaces in weakDeliminator
A workaround was mentioned, the behavior of the keyword stuff will not be touched for this, seems to work well enough for all our other highlightings.