Following naive snippet highlights such headers:
syn match asciidoctorH1 "^\_s*\n\a.*\n====*" syn match asciidoctorH2 "^\_s*\n\a.*\n----*" hi link asciidoctorH1 Title hi link asciidoctorH2 Title
But for asciidoc(tor) it is incorrect. The issue is in length of the dashes -- it should be exactly the same as text above it:
test header =========== he world --------
incorrect (shouldn't be highlighted):
test header ======= he world -----------
Basically, is there a way to find the length of the text above dashes and apply it to dashes? Or any other way to do it?