Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

两种内置的代码块问题反馈 #616

Closed
4 of 6 tasks
jovensun opened this issue Feb 20, 2018 · 5 comments
Closed
4 of 6 tasks

两种内置的代码块问题反馈 #616

jovensun opened this issue Feb 20, 2018 · 5 comments

Comments

@jovensun
Copy link

jovensun commented Feb 20, 2018

I certify that I have first consulted (check all with "x")

我确认我已经查看了 (使用 "x" 选择)


I'm submitting a (check one with "x")

我正在申请 (使用 "x" 选择)

  • bug report | 反馈一个 bug
  • feature request | 申请添加新的特性或功能
  • support request | 请求技术支持

Material的开发者们你们好,我在使用该主题中发现了下面两个问题。
1.prettify 代码过长时没有水平滚动条而是直接换行,如下图
prettify

hanabi

2.hanabi 无法解析 & 运算符。在代码中会显示成 &

虽然说在功能上没有什么影响,但是确实影响了美观。希望开发者们至少能够解决其一。十分感谢。

@VeronicaF
Copy link

期待解决第一个,手机浏览体验有点差。

@iCyris
Copy link

iCyris commented Apr 1, 2018

可以参考 https://github.com/viosey/hexo-theme-material/issues/383 进行修改,能解决你的第一个问题。

补充:该解决方案中代码缩进存在问题,下面贴一份我修改后的代码,并缩小了代码块左侧留白区域,使看起来更舒服些。

source/css/prettify.css 修改如下:

@charset "UTF-8";

/* for color-themes-for-google-code-prettify */
/* Automatically add a scroll bar instead of a newline */
pre{
    white-space: pre;
}

#post-content .prettyprint{
    padding: 1.2em;
    border-radius: 0;
}

#post-content ol,#post-content ul{
    padding-left: 32px;
    font-size: 1rem;
    margin: 0;
    overflow: initial;
}

#post-content pre code, #post-content pre tt {
    padding-right: 2em;
}

#post-content .prettyprint li.L0, #post-content .prettyprint li.L1,
#post-content .prettyprint li.L2, #post-content .prettyprint li.L3,
#post-content .prettyprint li.L4, #post-content .prettyprint li.L5,
#post-content .prettyprint li.L6, #post-content .prettyprint li.L7,
#post-content .prettyprint li.L8, #post-content .prettyprint li.L9 {
    padding-left: 0.5em;
}

source/css/prettify.min.css 修改如下:

pre{white-space:pre}#post-content .prettyprint{padding:1.2em;border-radius:0}#post-content ol,#post-content ul{padding-left:32px;font-size:1rem;margin:0;overflow:initial}#post-content pre code,#post-content pre tt{padding-right:2em}#post-content .prettyprint li.L0,#post-content .prettyprint li.L1,#post-content .prettyprint li.L2,#post-content .prettyprint li.L3,#post-content .prettyprint li.L4,#post-content .prettyprint li.L5,#post-content .prettyprint li.L6,#post-content .prettyprint li.L7,#post-content .prettyprint li.L8,#post-content .prettyprint li.L9{padding-left:.5em}

@jovensun @VeronicaF

@VeronicaF
Copy link

thx @iCyris

@Macr0phag3
Copy link

Cooool. thx @iCyris

@Singularity0909
Copy link

thx very much @iCyris

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants