markdown里如何显示HTML标签和转义字符
2016-09-02 16:33
295 查看
结论:用转义字符
例1:想在页面显示<br>代码为:
<code class="hljs perl has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: "Source Code Pro", monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">&<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">lt</span>;br&<span class="hljs-keyword" style="color: rgb(0, 0, 136); box-sizing: border-box;">gt</span>;</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right: 1px solid rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul>
将<和>分别写成了转义字符的形式。
常用转义字符表为:
显示结果 | 描述 | 实体名称 | 实体编号 |
---|---|---|---|
空格 | |||
< | 小于号 | < | < |
> | 大于号 | > | > |
& | 和号 | & | & |
“ | 引号 | " | " |
‘ | 撇号 | '(IE不支持) | ' |
代码为:
<code class="hljs bash has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: "Source Code Pro", monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">&<span class="hljs-comment" style="color: rgb(136, 0, 0); box-sizing: border-box;">#60;</span></code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right: 1px solid rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li></ul>
将&写成了转义字符的形式。
相关文章推荐
- markdown里如何显示HTML标签和转义字符?
- Markdown显示HTML标签以及转义字符
- 如何将从数据库中读出的带有html标签的字符串,让标签起效,显示在前台页面
- MVC 中如何将带有标签的字符串转换为HTML 标签 显示出来?
- 如何将从数据库中读出的带有html标签的字符串,让标签起效,显示在前台页面
- Play FrameWork中scala.html页面如何显示带有html标签元素的字符串信息
- html中字体,特殊字符和标签如何显示呢?
- SSH如何将从数据库中读出的带有html标签的字符串,让标签起效,显示在前台页面
- 如何将从数据库中读出的带有html标签的字符串,让标签起效,显示在前台页面
- IOS中如何显示带有html标签的富文本
- 如何去掉从数据库中读出的带有html标签的字符串,并是标签起效,显示在前台页面
- 如何解决HTML存到数据库后无法解析显示HTML标签
- 如何隐藏和显示HTML标签
- 如何在html 中显示带有 html 标签的string
- angular2如何识别字符串中的html标签,并按照html来显示视图
- 如何让含有html标签的数据能正确的在前台显示
- 如何隐藏和显示HTML标签
- 如何在html页面显示<…>标签内容
- php向前端发送的字符串中存在HTML标签如何正常显示
- thinkphp模板页如何显示含有html标签的赋值