Coder Social home page Coder Social logo

代码高亮问题; about huno HOT 6 CLOSED

letiantian avatar letiantian commented on June 24, 2024
代码高亮问题;

from huno.

Comments (6)

letiantian avatar letiantian commented on June 24, 2024

在hexo的配置文件里highlight的配置是true吗?上下篇的功能可以自己定制。

from huno.

ShomyLiu avatar ShomyLiu commented on June 24, 2024

highlight配置如下:
hightlight

from huno.

ShomyLiu avatar ShomyLiu commented on June 24, 2024

vim 下面的是效果,只有第一行显示行号

from huno.

ShomyLiu avatar ShomyLiu commented on June 24, 2024

解决了。。我的代码快没有指定 语言。 指定了语言就ok了  麻烦您了

from huno.

letiantian avatar letiantian commented on June 24, 2024

1、清除浏览器缓存看看。

2、高亮配置不要在theme的_config.yml中配置,huno不支持这种配置。应该在hexo的_config.yml中配置。hexo的_config.yml默认启用了高亮:

highlight:
  enable: true
  line_number: true
  auto_detect: true
  tab_replace:

除非是你这边要使用其他的高亮方法。

3、可否把markdown博客中代码那一块截个图?用firebug把生成网页中显示代码的那部分html看看有什么问题?

我的是这样的:
001

生成的html是:

<table>
    <tbody>
        <tr>
            <td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td>
            <td class="code"><pre><span class="line"><span class="keyword">var</span> i = <span class="number">0</span>;</span><br><span class="line"><span class="keyword">var</span> log = <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>{</span><br><span class="line">    <span class="built_in">console</span>.log(<span class="built_in">arguments</span>);</span><br><span class="line">};</span><br></pre></td>
        </tr>
    </tbody>
</table>

from huno.

ShomyLiu avatar ShomyLiu commented on June 24, 2024

谢谢! 我没有指定语言

from huno.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.