【问题标题】:Markup ommited by Google Code PrettifyGoogle Code Prettify 省略的标记
【发布时间】:2017-08-23 20:49:22
【问题描述】:

在我看来,我有以下代码:

<pre class="prettyprint linenums lang-cs">
    @Model.ArticleText
</pre>

如果 ArticleText 只是一个包含代码语法的文本,例如:

"public ArticlesViewModel()
{
    public string ArticleName { get; set; }
}"

然后,在视图中,该文本显示为一段语法高亮的漂亮代码。但是,如果我想对该文本添加一些评论,例如:

"This is articles ViewModel:
public ArticlesViewModel()
{
    public string ArticleName { get; set; }
}"

是否有任何标记可以用来包装该评论,而 Code-Prettify 会忽略这些标记?

【问题讨论】:

    标签: asp.net-mvc google-code-prettify


    【解决方案1】:

    来自代码:

    /**
    * A class that indicates a section of markup that is not code, e.g. to allow
    * embedding of line numbers within code listings.
    * @const
    */
    var PR_NOCODE = 'nocode'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-23
      • 1970-01-01
      • 1970-01-01
      • 2013-04-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多