list - Markdown:在嵌套列表之后继续列表中的文本
问题描述
我需要在列表中插入一个子列表,然后继续项目中的文本:
1. Start of the item text
- First item of sublist;
- Second item of sublist;
More text of the first item.
2. Second Item
3. Third item
嵌套列表后面的文本在渲染后没有正确对齐(应该对齐“开始”,对齐“1.”)。有什么建议吗?
解决方案
文本应该与数字后的文本左对齐,然后渲染的文本将与之对齐。
这是您的示例:
1. Start of the item text
- First item of sublist;
- Second item of sublist;
More text of the sublist of the first item.
The pending text of "More text of the sublist of the first item."
More text of the first item.
The pending text of "More text of the first item."
2. Second Item
3. Third item
第一行文本有两个字符:文本内容前1
.
有一个空格
Start of...
那么你要对齐的文本也应该在文本内容之前有3个空格
More text of...
此外,在文本内容之前有<=N 个空格(N 表示列表上下文的前缀文本的长度,在本例中,N=3)将使内容与此列表文本对齐
例如,有1 ~ 3 个空格将使文本与第 1 行文本对齐,有4 ~ 6 个空格将使文本与第 2 行文本对齐,
推荐阅读
- java - 如何在硒中捕获多个段落标签的所有包装文本?
- c# - 在 Fody 的开放泛型中添加对泛型方法的调用
- hibernate - 如何在 Grails 3 中覆盖 DomainClass getter
- arrays - 给定范围的数组的最小连续和
- python - 如何使用python提取和打印表格中所有标签内的文本
- html - HTML / CSS - 箭头在轮播下方
- python - 值错误:无法将字符串转换为浮点数:“男性”
- git - 使用 REST API 添加对 JIRA 的提交?
- java - 对于什么类型的 A 和 B,简单的赋值语句 A = B 在 C++ 中合法但在 Java 中不合法?
- contenteditable - contenteditable 不适用于 cdkDrag