import re


def sub_toc(line):
    """Substitute the HTML markup into a line of the TOC."""
    return re.sub(
        r'([0-9]+)( +)\|( +)([0-9:\.]+)( +)\|( +)([0-9:\.]+)( +)\|( +)'
        r'([0-9]+)( +)\|( +)([0-9]+)',
        r'<span class="log4">\1</span>\2<strong>|</strong>'
        r'\3<span class="log1">\4</span>\5<strong>|</strong>'
        r'\6<span class="log1">\7</span>\8<strong>|</strong>'
        r'\9<span class="log1">\10</span>\11<strong>|</strong>'
        r'\12<span class="log1">\13</span>',
        line,
    )