def link(token, base_url):
    """Validation for ``link``."""
    if get_keyword(token) == 'none':
        return 'none'
    parsed_url = get_url(token, base_url)
    if parsed_url:
        return parsed_url
    function = parse_function(token)
    if function:
        name, args = function
        prototype = (name, [arg.type for arg in args])
        if prototype == ('attr', ['ident']):
            return ('attr()', args[0].value)
Validation for ``link``.
weasyprint/css/validation/properties.py