如何将Unicode符号添加到提交按钮 [英] How to add a unicode symbol to a submit button

查看:80
本文介绍了如何将Unicode符号添加到提交按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在SubmitField的文本中添加一个unicode.

I would like to add a unicode to the text of a SubmitField.

例如,代码

submit = SubmitField('✉ Send') 

不起作用.我该如何更改以显示此信封unicode?

does not work. How can I change that to show this envelope unicode?

推荐答案

只需在\uhhhh转义序列中使用unicode代码点,就无需使用HTML转义:

Just use the unicode codepoint in a \uhhhh escape sequence, there is no need to use HTML escapes:

submit = SubmitField('\u2709 Send')

甚至是代码点本身:

submit = SubmitField('✉ Send')

产生的字符串值完全相同.

The string value produced is exactly the same.

用引号引起来的标签可以确保正确处理HTML,因此标签值中的所有&字符都被编码为&,从而破坏了✉引用.

The label is quoted to ensure proper handling in HTML, so any & characters in the label value are encoded to &, breaking your ✉ reference.

这篇关于如何将Unicode符号添加到提交按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆