using split_contents(), removing import re, adding docstrings for the template tag