1

我有一个bundle exec jekyll serve使用Minima默认主题在本地运行的 Jekyll 网站。

当我使用代码块时,框的背景颜色和框内文字的背景颜色不同,导致呈现丑陋:

```r
filter(grepl("A", Source)) %>%
group_by(Source) %>%
summarise(Amount = sum(Amount)) %>%
mutate(Percentage = Amount / sum(Amount) * 100)
```

在此处输入图像描述

对于我在代码块开头定义的大多数语言以及未定义语言(例如```r, ```python ```)时,都会出现此问题,但有趣的是,对于```shell-script.

相关_sass/minima/_base.scss部分(我认为)如下所示:

/**
 * Blockquotes
 */
blockquote {
  color: $grey-color;
  border-left: 4px solid $grey-color-light;
  padding-left: $spacing-unit / 2;
  @include relative-font-size(1.125);
  letter-spacing: -1px;
  font-style: italic;

  > :last-child {
    margin-bottom: 0;
  }
}



/**
 * Code formatting
 */
pre,
code {
  @include relative-font-size(0.9375);
  border: 1px solid $grey-color-light;
  border-radius: 3px;
  background-color: #e6e6e6;
}

code {
  padding: 1px 5px;
}

pre {
  padding: 8px 12px;
  overflow-x: auto;

  > code {
    border: 0;
    padding-right: 0;
    padding-left: 0;
  }
}

如何使整个代码块使用当前仅用于文本背景的灰色?

编辑:禁用胭脂语法高亮后,代码块正确显示,以及语法高亮。

编辑:使用 github 页面构建网站时也会出现此问题

4

0 回答 0