Html 在 Markdown 中的标题 (<h1>) 中强制换行 (<br/>)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13730982/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Force line break (<br/>) in header (<h1>) in Markdown
提问by David Moles
I'm trying to create a two-line <h1>
in Markdown, something along the lines of:
我正在尝试<h1>
在 Markdown 中创建一个两行,大致如下:
<h1>Title<br/>byline</h1>
The Markdown docs say:
Markdown 文档说:
When you do want to insert a
<br />
break tag using Markdown, you end a line with two or more spaces, then type return.
当您确实想
<br />
使用 Markdown插入中断标记时,您可以用两个或多个空格结束一行,然后键入 return。
Unfortunately, this only seems to work for paragraphs -- if I try it with an <h1>
(dots · indicate spaces):
不幸的是,这似乎只适用于段落——如果我尝试使用<h1>
(点·表示空格):
#·Title··
byline
the trailing spaces are ignored and I just get:
尾随空格被忽略,我只是得到:
<h1>Title</h1>
<p>byline</p>
Can anyone tell me a workaround for this?
谁能告诉我一个解决方法?
P.S. I'm using vanilla Markdown 1.0.1 from the command line.
PS我从命令行使用vanilla Markdown 1.0.1。
回答by David Moles
Turns out the answer is just "use <br/>
."
原来答案只是“使用” <br/>
。
# Title <br/> byline
produces
产生
<h1>Title <br/> byline</h1>
** facepalm**
**面部**
回答by Raj Kumar
You can also do double space
at the end of the line.
For example, this text appears in the same line even though I've written it on the next line.
This appears on a new line.
你也可以double space
在行尾做。例如,即使我将其写在下一行,该文本也会出现在同一行中。
这出现在一个新行上。
The thing is there are 2 blank spaces after next line..
. (Consider those two dots as spaces)
问题是next line..
.后面有 2 个空格。(将这两个点视为空格)
Hope this helps. This also seems better than </BR>
.
希望这可以帮助。这似乎也比</BR>
.
Reference: http://markdown-guide.readthedocs.io/en/latest/basics.html
参考:http: //markdown-guide.readthedocs.io/en/latest/basics.html