Mustache/Handlebars: minor fixes
ClosedPublic

Authored by nibags on Oct 2 2019, 5:31 AM.

Details

Summary

Using WordDetect rules for Tags causes them not to be highlighted after text. This only affects the folding of some tags. I also used non-capture groups in RegExpr rules.

Changes:

  • Fix the name of the tag section (before it was written "sectiond").
  • Use kateversion="5.44", since insensitive WordDetect is used.
  • Use non-capturing groups in RegExpr rules.

Diff Detail

Repository
R216 Syntax Highlighting
Branch
fix-delimiters-mustache
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 17318
Build 17336: arc lint + arc unit
nibags created this revision.Oct 2 2019, 5:31 AM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptOct 2 2019, 5:31 AM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
nibags requested review of this revision.Oct 2 2019, 5:31 AM

Would it also be an option to fix WordDetect? I always thought WordDetect ignores the string contents, it should only check on the boundaries left and right

Indeed, WordDetect checks only the boundaries. What happens is that when using WordDetect with <tag, you need a border character before <, when it shouldn't.
That is, <tag will not match in the text: "word<tag>".
It's correct to use RegExpr with <tag\b instead of WordDetect.

Hm, would it make sense to change this? I.e. if the word itself has a word boundary, also use this?

nibags added a comment.Oct 3 2019, 5:16 AM

I think it makes sense to change this in WorDetect: verify delimiter characters on the left and right edge of the string, either inside or outside the string. I will make another diff with this.

Thanks a lot!

nibags updated this revision to Diff 67297.Oct 4 2019, 3:27 AM

Minor corrections:

  • Restore WordDetect rules
  • Use kateversion="5.44" (WordDetect with insensitive).
nibags retitled this revision from Mustache/Handlebars: fix delimiters in HTML tags to Mustache/Handlebars: minor fixes.Oct 4 2019, 3:28 AM
nibags edited the summary of this revision. (Show Details)Oct 4 2019, 3:34 AM
nibags added a comment.Oct 4 2019, 3:37 AM

As the delimiters in WordDetect rules were changed in D24378, I updated this diff only by making minor fixes in the Mustache/Handlebars definition.

dhaumann accepted this revision.Oct 4 2019, 6:35 AM
This revision is now accepted and ready to land.Oct 4 2019, 6:35 AM
nibags closed this revision.Oct 4 2019, 9:06 AM