You could parse the attribute runs of the text. See e.g. Convert text links to Devonthink links for an example.