如何在bootstrap_alert中放置一个链接?
msg=mark_safe('Please visit our forum site <a href="talk.edgle.com" class="alert-link">Edgle Talk</a> as well!')
render_alert(msg)
'<div class="alert alert-info alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>Please visit our forum site <a href="talk.edgle.com" class="alert-link">Edgle Talk</a> as well!</div>'
如所见,由于以下函数调用链,html元素被转义:
bootstrap_alert-> render_alert-> render_tag-> format_html-> conditional_escape