如何插入换行符< br>在降价 [英] How to insert a line break <br> in markdown
问题描述
我正在尝试创建一个Markdown文件,其中某些段落的下一行包含链接和一行文本.我遇到的问题是,当我在链接后添加新行时,它是用单独的<p>
标签呈现的.
I'm trying to create a markdown file with some paragraphs containing both a link and a line of text on the next line. The problem I've encountered is that when I make a new line after the link, it is rendered with a separate <p>
tag.
我的降价幅度如下:
[Name of link](url)
My line of text
哪个呈现为以下html:
Which is rendered to the following html:
<p>
<a href="url">Name of link</a>
</p>
<p>My line of text</p>
相反,我希望它像这样渲染:
Instead I want it to render like so:
<p>
<a href="url">Name of link</a><br> // not necessarily with a <br> tag but on a separate line
My line of text
</p>
我还尝试在降价促销中使用单行换行符:
I've also tried using a single line break in the markdown:
[Name of link](url)
My line of text
但是然后链接和文本都显示在同一行上,但没有换行符.
But then both the link and the text is rendered on the same line, but without a line break.
有关如何解决此问题的任何建议?预先感谢!
Any suggestions on how to solve this? Thanks in advance!
推荐答案
尝试在第一行之后添加2个空格(或反斜杠\
):
Try adding 2 spaces (or a backslash \
) after the first line:
[Name of link](url)
My line of text\
视觉上:
[Name of link](url)<space><space>
My line of text\
输出:
<p><a href="url">Name of link</a><br>
My line of text<br></p>
这篇关于如何插入换行符< br>在降价的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!