Detect the current selection and add an active class to the corresponding markdown snippet link