Split <li><a> to <a> string manipulation into its own function