Multiline regex tagging matches 3 lines before Universal Ctags

64 Views Asked by At

I am indexing the Mozilla mdn CSS web documents , and making tags accordingly. I have the documentation related to the CSS properties and some other topics in one single file localdocu.mdncssdan, each topic starts with # followed by a newline then the name of the topic.

The following is a simplified view of the document.

This page was last modified on Jul 7, 2023 by MDN contributors.

(...)

#
animation-composition

The animation-composition CSS property specifies the composite operation
to use when multiple animations affect the same property simultaneously.
(...)

This page was last modified on Jun 26, 2023 by MDN contributors.



#
animation-delay

The animation-delay CSS property specifies the amount of time to wait
from applying the animation to an element before beginning to perform
(...)

What I have is the following rule

--kinddef-mdncssdantags=t,topic,topics
--mline-regex-mdncssdantags=/^#\n(\w.*)$/\1/t/{mgroup=0}

Which works , detecting the tags , but the regex is refering to as the destiny of the tags is shifted some lines up

animation-composition   localdocu.mdncssdan /^This page was last modified on Jul 7, 2023 by MDN contributors.$/;"   t
animation-delay localdocu.mdncssdan /^This page was last modified on Jun 26, 2023 by MDN contributors.$/;"  t

So this is not accurate, when I open say animation-delay , it will go 3 lines up to the This page was last modified.... , and the biggest issue is that, when this line is the same for other topics (say I have got other topic which its 3 lines upper is that same This page was last modified on Jun 26 , then the tag referecing system is completely messed up)

0

There are 0 best solutions below