admin管理员组文章数量:1122846
When writing Markdown, generally newlines are not a problem:
This is a very long sentence in a short
paragraph, or maybe a paragraph made of
a single very long sentence.
This is an intended separate paragraph.
should be the same as
This is a very long sentence in a short paragraph, or maybe a paragraph made of a single very long sentence.
This is an intended separate paragraph.
But apparently not when using lists:
Here is some text:
- Short title:
- This is a very long sentence in a short
paragraph, perhaps.
is not the same as
Here is some text:
- Short title:
- This is a very long sentence in a short paragraph, perhaps.
Having the linebreak results in it being embedded in the list item. I would like to continue using linebreaks for readability in my Markdown source (max line length 120) without impacting its look when rendered (e.g., on GitHub, or rendered to a PDF). Is it possible? If not, is there a better way to have a short title followed by a longer explanation, without an entire heading?
When writing Markdown, generally newlines are not a problem:
This is a very long sentence in a short
paragraph, or maybe a paragraph made of
a single very long sentence.
This is an intended separate paragraph.
should be the same as
This is a very long sentence in a short paragraph, or maybe a paragraph made of a single very long sentence.
This is an intended separate paragraph.
But apparently not when using lists:
Here is some text:
- Short title:
- This is a very long sentence in a short
paragraph, perhaps.
is not the same as
Here is some text:
- Short title:
- This is a very long sentence in a short paragraph, perhaps.
Having the linebreak results in it being embedded in the list item. I would like to continue using linebreaks for readability in my Markdown source (max line length 120) without impacting its look when rendered (e.g., on GitHub, or rendered to a PDF). Is it possible? If not, is there a better way to have a short title followed by a longer explanation, without an entire heading?
Share Improve this question edited Nov 22, 2024 at 8:29 Guillius 4614 silver badges11 bronze badges asked Nov 22, 2024 at 8:14 404 Name Not Found404 Name Not Found 3594 silver badges15 bronze badges 2- Could you add more information on where this is not rendering as you expect? On GitHub your markdown renders as you expect it to. – Matt Pitkin Commented Nov 22, 2024 at 9:06
- I was using an online editor (stackedit), it renders the linebreaks there. Indeed on GitHub and VSCode it renders as expected – 404 Name Not Found Commented Nov 22, 2024 at 9:16
1 Answer
Reset to default 0I cannot reproduce the problem you are having as for me:
This
Here is some text:
- Short title:
- This is a very long sentence in a short
paragraph, perhaps.
And this
Here is some text:
- Short title:
- This is a very long sentence in a short paragraph, perhaps.
Is producing the same result of
Here is some text:
- Short title:
- This is a very long sentence in a short paragraph, perhaps.
I think you might have some extra spaces at the end of - This is a very long sentence in a short
because two spaces at the end of a line is rendered as a line break.
本文标签: line breaksHow do I add linebreaks in Markdown list but not when renderedStack Overflow
版权声明:本文标题:line breaks - How do I add linebreaks in Markdown list but not when rendered? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736305222a1932510.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论