use length of match for replacement instead of length of regex
add renderNote to render a note from text + list of mentions