def get_meta(txt):
    """Parse meta information from text if available and return as dict.

    meta information is a block imbedded in "---\n" lines having the format:

        key: value

    both are treated as strings the value starts after the ": " end ends with
    the newline.
    """
    SEP = '---\n'
    meta = dict()
    if txt.count(SEP) > 1 and txt.startswith(SEP):
        stuff = txt[len(SEP):txt.find(SEP, 1)]
        txt = txt[txt.find((SEP), 1)+len(SEP):]
        for i in stuff.splitlines():
            if i.count(':') > 0:
                key, value = i.split(':', 1)
                value = value.strip()
                meta[key] = value
    return meta, txt