sS dynamize(S text) { Matcher m = Pattern.compile("#([0-9]+)").matcher(htmlencode(text).replace("&#", "&~~~")); new StringBuffer buf; while (m.find()) { S id = m.group(1); mreplace(m, buf, ahref(snippetLink(id), "#" + id)); } m.appendTail(buf); ret dynamizeGlobalIDsInHTML(str(buf).replace("&~~~", "&#")); }