You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在AsciiDoc中将图片说明文本置于生成图像右侧?

解决AsciiDoc中Salt图与说明文本左右排列的问题

可行方案:修正表格内块嵌套语法

在表格单元格中放置Salt块时,需通过+标记块内容的起始,避免AsciiDoc将块边界误解析为表格语法,导致渲染错误。

完整代码示例

[cols="1,1", frame=none, grid=none]
|===
| +
[[login-page]]
[salt, id="login-page", format="svg", align="left"]
----
{
  Login    | "MyName   "
  Password | "****     "
  [Cancel] | [  OK   ]
}
----

| This diagram illustrates the design of the login page, which includes input fields for username and password, along with Cancel and OK action buttons.
|===

关键说明

  • 添加+后,AsciiDoc会将后续的Salt块识别为单元格内的独立块元素,正确渲染生成SVG图像,避免"unterminated salt block"这类解析错误。
  • 可通过修改cols属性调整图像与文本的宽度比例(如cols="2,3"让文本列更宽),满足排版需求。
  • 该方案同时兼容asciidoctor(HTML输出)和asciidoctor-pdf(PDF输出)。

内容的提问来源于stack exchange,提问作者j3d

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.16 16:50:02