GitHub markdown中的内联代码语法高亮显示? [英] Inline code syntax highlighting in GitHub markdown?

查看:490
本文介绍了GitHub markdown中的内联代码语法高亮显示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GitHub-flavored markdown支持代码块中的语法突出显示。这是通过添加三重严格代码块标记旁边的语言名称完成的:

 ```ruby 
需要'redcarpet'
markdown = Redcarpet.new(Hello World!)
puts markdown.to_html
```

标准markdown还通过将文本包装在`single graves` 中来支持内联代码块。有没有办法给这些内嵌代码块添加语法突出显示?

解决方案

非常确定 GitHub flavored markdown

然而,它可能在 Pandoc's markdown

  `Redcarpet.new(Hello World!)`{.ruby} 


GitHub-flavored markdown supports syntax highlighting in codeblocks. This is done by adding the name of the language next to the triple-grave codeblock markers:

```ruby
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
```

Standard markdown also supports inline codeblocks by wrapping text in `single graves`. Is there any way to add syntax highlighting to these inline codeblocks?

解决方案

Quite sure it's not possible with GitHub flavoured markdown.

However, it is possible in Pandoc's markdown:

`Redcarpet.new("Hello World!")`{.ruby}

这篇关于GitHub markdown中的内联代码语法高亮显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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