简体   繁体   English

Jekyll,如何忽略空间和空间的语法4次

[英]Jekyll, How to ignore syntax of space and space 4 times

I'm newbie of Jekyll 我是Jekyll的新手

I'm trying to make a post with markdown in Jekyll 我正尝试在Jekyll中发布带有markdown的帖子

As i know, starting with 4 spaces in a new line makes the line as a code style like bellow. 据我所知,在新行中以4个空格开头使行像波纹管一样成为一种代码样式。

I started with 4 spaces

Also in markdown, even though i typed 'enter', it doesn't work. 同样在降价促销中,即使我输入了“ enter”,它也不起作用。

So every line i type <br/> for insert a enter in every single line. 因此,我键入的每一行<br/>在每行中插入一个回车。

let me summarize what i'm looking for. 让我总结一下我在寻找什么。

  1. Even though text starts with 4 spaces, I don't want it could be looked as plain text not code style. 即使文本以4个空格开头,我也不希望将其视为纯文本而不是代码样式。 So is there any reserved word like {% ignore from code %} (it's not existing but what i'm looking for)it ignore 4 spaces from code style. 因此,是否有任何保留字,例如{% ignore from code %} (它不存在,但我在寻找什么),它会忽略代码样式中的4个空格。 and just plain text style 只是纯文字样式

  2. Is there any plug-in or built-in way that insert enter without <br/> 有没有<br/>插入Enter的任何插件或内置方式?

1. 4 spaces indentation 1. 4个空格缩进

There is no way to configure kramdown to ignore 4 space indentation. 无法将kramdown配置为忽略4个空格缩进。

But : 但是:

a line of text followed by an empty newline 

    and an indented line 

Last line is understood as a code block. 最后一行被理解为代码块。

But if you remove the empty newline : 但是,如果您删除空的换行符:

a line of text followed by
    an indented line

Everything is processed as text 一切都作为文本处理

2. replacing newline by BRs 2.用BR替换换行符

You have to configure kramdown from _config.yml : 您必须从_config.yml配置kramdown:

kramdown:
  hard_wrap: true

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM