如何阻止Kramdown在代码块中删除凹痕?
在我的Jekyll网站上渲染Python CodeBlocks时,Kramdown删除了所有凹痕。
代码:
from sort.AbstractSort import AbstractSort
class BubbleSort(AbstractSort):
@staticmethod
def swap(arr, i, j):
arr[i], arr[j] = arr[j], arr[i]
def _sort(self, arr):
for i in range(len(arr) - 1):
for j in range(len(arr) - 1):
if arr[j] > arr[j + 1]:
BubbleSort.swap(arr, j, j + 1)
return arr
kramdown渲染:
kramdown没有最好的文档,我找不到任何明显的设置,我应该在我的jekyll网站的_config.yaml
中更改。
我正在GitHub页面上托管该网站。
如果不可能,也许我应该更改为其他渲染?但是,这也记录在案很差,我改用GFM的尝试失败了。
When rendering Python codeblocks on my Jekyll site, Kramdown removes all of the indents.
The code:
from sort.AbstractSort import AbstractSort
class BubbleSort(AbstractSort):
@staticmethod
def swap(arr, i, j):
arr[i], arr[j] = arr[j], arr[i]
def _sort(self, arr):
for i in range(len(arr) - 1):
for j in range(len(arr) - 1):
if arr[j] > arr[j + 1]:
BubbleSort.swap(arr, j, j + 1)
return arr
Kramdown render:
Kramdown doesn't have the best documentation and I couldn't find any obvious settings that I should change in _config.yaml
of my Jekyll site.
I'm hosting the site on GitHub pages.
If it is not possible, maybe I should change to a different rendered? But then this is also poorly documented and my attempts to switch to GFM had failed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AS benjamin w。 CSS 。
要解决问题,请更改:
解决
问题。
As Benjamin W. have written, this is due to bad CSS configuration in
assets/css/style.css
.To solve the problem, change:
to
solves the problem.