import html


def linebrk(s, n):
    """ Break input string s with <br/> for every n charactors."""
    result = ""
    j = 0
    for i, c in enumerate(s):
        if j == n and i != len(s) - 1:
            result = result + "\n"
            j = 0
        j = j + 1
        result = result + c
    result = html.escape(str(result), quote=True)
    result = result.replace("\n", "<br/>")
    return result