Kate syntax highlighting not working in 17.12

Tim Edwards liststuff at fastmail.com.au
Thu Jul 26 06:47:48 BST 2018


Hi,

I'm trying to use Kate to provide highlighting for headers in text files
(ending .txt). Basically I want to be able to use 3 levels of headers:
***Top level - bold and underlined***

**Mid level - bold**

*Lower Level - underlined*

The bold style works as expected, but underlining doesn't seem to work
in 17.12 (Kubuntu 18.04). I have the following in
~/.local/share/katepart5/syntax/normaltext.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!-- Syntax highlighting that I want applied to all text files -->
<language name="Normal Text Files with Headers" version="1.00"
kateversion="2.4"
          section="Other" extensions="*.txt"
          license="public domain" mimetype="text/plain">
   
  <highlighting>
    <contexts>
      <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
        <!-- Match header lines like ***Buying Process*** -->
        <RegExpr String="^\*\*\*\S.*" attribute="topLevelHeader" />
        <!-- Match header lines like **January 2017** -->
        <RegExpr String="^\*\*\S.*" attribute="secondLevelHeader" />
        <!-- Match header lines like *Quantitative Analysis* -->
        <RegExpr String="^\*\S.*" attribute="thirdLevelHeader" />
      </context>
    </contexts>
    <itemDatas>
      <itemData name="Normal Text" defStyleNum="dsNormal" />
      <itemData name="topLevelHeader" defStyleNum="dsNormal" bold="true"
underline="true" />
      <itemData name="secondLevelHeader" defStyleNum="dsNormal"
bold="true" />
      <itemData name="thirdLevelHeader" defStyleNum="dsNormal"
underline="true" />
    </itemDatas>
  </highlighting>
</language>

Anything I need to add or change in the XML above to have it work? I
think the underlining was working with Kubuntu 16.04. Could the
difference be something to do with the change to KSyntaxHighlighting
Framework?

Best regards
Tim
p, li { white-space: pre-wrap; }normaltext.xml


More information about the KWrite-Devel mailing list