Scratch: extract key-value pairs from tags