Modification of the process to search for the segments to highlight.
Before: We had to navigate through parent nodes, child nodes and sibling nodes and the code was getting a bit messy with multiple special conditions for title segment/last segment/special segments (as in Snp4.3).
Now: we first get all elements with class "segment" in an array and just navigate through this array to highlight desired segments.
Performance-wise there aren't many segments in each page so it is seamless and the code is way simpler that way.
Modification of the process to search for the segments to highlight.
Before: We had to navigate through parent nodes, child nodes and sibling nodes and the code was getting a bit messy with multiple special conditions for title segment/last segment/special segments (as in Snp4.3).
Now: we first get all elements with class "segment" in an array and just navigate through this array to highlight desired segments.
Performance-wise there aren't many segments in each page so it is seamless and the code is way simpler that way.