Skip to content

[0118] 首行缩进在节、代码块、列表后生效#3347

Open
da-liii wants to merge 1 commit into
mainfrom
da/200_27/0118_indent_after_block
Open

[0118] 首行缩进在节、代码块、列表后生效#3347
da-liii wants to merge 1 commit into
mainfrom
da/200_27/0118_indent_after_block

Conversation

@da-liii
Copy link
Copy Markdown
Contributor

@da-liii da-liii commented May 14, 2026

摘要

在样式语言中新增开关 indent-after-block,控制节、代码块、列表等结构后的段落是否保留首行缩进。

变更内容

  • std-markup.ts: 定义新变量 indent-after-block,默认 false
  • section-base.ts: sectional-no-indent 仅在开关关闭时发射 <no-indent*>
  • std-list.ts: render-list 尾部 <no-indent*> 受开关控制
  • compact-list.ts: 紧凑列表尾部 <no-indent*> 受开关控制
  • env-program.ts: render-code 尾部 <no-indent*> 受开关控制
  • framed-program.ts / modern-program.ts: 算法代码块尾部 <no-indent*> 受开关控制
  • article.ts: article 样式默认开启 <assign|indent-after-block|true>

测试方式

  1. 新建 article 文档,加载 indent-paragraphs
  2. 在节标题后输入段落,观察首行是否缩进
  3. 在代码块后输入段落,观察首行是否缩进
  4. 在有序/无序列表后输入段落,观察首行是否缩进
  5. 新建 generic 文档,重复上述步骤,确认首行不缩进(保持旧行为)

默认行为

  • generic 等样式:保持现有行为(关闭)
  • article 样式:默认开启,与 LaTeX article 等主流排版引擎行为一致

🤖 Generated with Claude Code

在样式语言中新增开关 indent-after-block,控制节、代码块、列表等
结构后的段落是否保留首行缩进。

- generic 等样式默认关闭(保持现有行为)
- article 样式默认开启
- 用户可在导言区通过 <assign|indent-after-block|true/false> 手动覆盖

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant