Add more highlighting for nested languages in markdown.
ClosedPublic

Authored by vandenoever on Feb 23 2019, 6:45 PM.

Diff Detail

Repository
R216 Syntax Highlighting
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
vandenoever created this revision.Feb 23 2019, 6:45 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptFeb 23 2019, 6:45 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
vandenoever requested review of this revision.Feb 23 2019, 6:45 PM
vandenoever retitled this revision from yAdd more highlighting for nested languages in markdown. to Add more highlighting for nested languages in markdown..

Could you extend autotests/input/test.markdown ?
Then call ./autotests/update-reference-data.sh in the build folder to copy the changes into the src folder, and update this patch.

PS: And increase the "version" in the langauge xml element at the beginning of the file :-)

  • added more languages,
  • updated language version
  • updated test files

Even folding works inside fenced blocks.

After running ./autotests/update-reference-data.sh autotests/folding/example.rmd.fold changed. I did not commit that change.

The language version is now updated and I added a few more languages.

Looks good to me, thanks.

Before committing, could you increase the kateversion="5.0" in the language xml element as well? Otherwise KDE 4 users could get this via the download dialog as well, without getting the depending files due to 5.0 requirements in the other xml files. Then, the local xml files are inconsistent and broken.

dhaumann accepted this revision.Feb 24 2019, 7:38 AM
This revision is now accepted and ready to land.Feb 24 2019, 7:38 AM

Increased kateversion to 5.0.

This revision was automatically updated to reflect the committed changes.

I see that one test fails after committing this patch. The example output was modified by /autotests/update-reference-data.sh but I did not submit it. I thought it was not related to the markdown change.

Well, if it's fixed by adding the missing reference update then please do so.

Hi Jos, could you please check again the output of the highlighting indexer?

ContextChecker::check: "/home/dh/kde/kf5/src/frameworks/syntax-highlighting/data/syntax/markdown.xml" Unused contexts: QSet("kconfig-code")

The checker says that this context is unused... I think this is a bug.

Jos fixed it in commit

1653403267ed9ad0a27ee4042be8e0d714a5dcc4

I made that check now required.

All current files pass, people can comment out contexts during development.

713c3f918fd0102d91ee893cbe91c95bfe39c4d3

Good idea, thanks.