v4.3.02026-11-06
What's Changed
Changelog
Features
* Render Lini diagrams through Kroki (requires Kroki 0.34.0 or later), by upgrading asciidoctor-kroki to 2.0.0 (#1208)
* Render [plantuml] blocks in the preview and in exported HTML without Kroki, using @plantuml/core, when asciidoc.extensions.enableKroki is disabled. Exported HTML loads the renderer from a CDN, and PDF exports with wkhtmltopdf keep the source of the diagram. The preview's Content Security Policy now allows 'wasm-unsafe-eval' in script-src, needed to compile the WebAssembly layout engine of PlantUML, without allowing unsafe-eval (#1188)
Improvements
Log how long each conversion and each parse of a document takes, split into phases, along with the size of the document, in the Asciidoctor output channel at the Debug* log level, to find out which documents are slow to preview (#1245)
* Display the first change after a pause in the preview immediately, instead of waiting for asciidoc.preview.refreshInterval, now 500 ms by default instead of 2 s. While typing, the preview no longer starts a new update before the previous one ends, waits longer between updates on documents that are slow to convert, and no longer updates while it is hidden (#588)
* Keep displaying a diagram or an image in the preview until its new version is loaded, instead of moving the page when it fails to load, for instance on a syntax error while typing a Kroki diagram. If the new version cannot be loaded, the previous one stays dimmed (#1225)
* Support :kroki-fetch-diagram: in VS Code for the Web, where fetched diagrams are embedded as data URIs instead of being replaced by an error block, by upgrading asciidoctor-kroki to 2.0.0 (#1208)
* Keep downloaded diagrams in a persistent cache (~/.cache/kroki by default), so that unchanged diagrams with :kroki-fetch-diagram: are no longer downloaded again. Set :kroki-cache: false to disable it, or :kroki-cache-dir: to move it (#1208)
Bug fixes
* Reveal the line displayed at the top of the preview when scrolling it, instead of the line below it in the editor (#1231)
* Include the leading period in the docfilesuffix attribute in the preview (.adoc instead of adoc), as Asciidoctor does when converting a file, so that the preview no longer differs from the generated HTML (#1235)
* Keep the scroll position of each document in the preview, instead of applying the scroll position of the previously previewed document when the preview switches to another document (#1206)
* Keep the errors and warnings of a document in the Problems panel when it is parsed at the same time as another one, for instance when opening several documents, instead of silently dropping them (#1229)
* Keep the editor and the preview at the same position while the preview reloads: images, math and diagrams no longer scroll the editor as they load, and no longer push the displayed line out of the preview. Scrolling the preview during the loading takes over immediately (#1230)
* Stop reloading the whole preview on every edit of a document that has a title, which made diagrams disappear until they were loaded again and moved the page. The preview now updates only the blocks that changed (#1225)
* Fully reload the preview on each update when the document has docinfo content, so that its scripts run again instead of leaving raw content on the page, for instance formulas rendered by KaTeX (#1205)
* Stop rendering Mermaid diagrams again on every preview update, including edits elsewhere in the document (#1188)
* Do not write the diagrams fetched with :kroki-fetch-diagram: into the workspace when data-uri is set: the preview now embeds them directly (#1208)
* Stop running asciidoctor-kroki during the diagnostics and language-features parse, which sent each diagram to the Kroki server on every edit and, with kroki-fetch-diagram, wrote images into the workspace even with the preview closed. Diagram errors no longer appear in the Problems panel, but remain visible in the preview (#1221)
* Use Highlight.js in the preview whatever the value of source-highlighter, as it is the only highlighter available there, instead of leaving source blocks without highlighting when the value is, for example, rouge, coderay or pygments (#1217)
* Only add the origin of a valid http: or https: kroki-server-url to the preview's Content Security Policy, so that a document cannot weaken the policy through this attribute (#1212)
* Honor a kroki-server-url set in asciidoc.preview.asciidoctorAttributes when asciidoc.extensions.kroki.serverUrl is also set, and apply asciidoc.extensions.kroki.serverUrl to the diagnostics and language-features parse as well (#1207). A kroki-server-url set in that setting is locked, so it also takes precedence over the document header and .asciidoctorconfig; use kroki-server-url@ to let them override it. Exports do not read asciidoc.preview.asciidoctorAttributes and are unchanged
* Generate the nonce of the preview's Content Security Policy from a secure random source instead of the clock, so that a document cannot guess it to run inline scripts (#1214)
* Keep the inline formatting toggles (asciidoc.toggleBold, asciidoc.toggleItalic, asciidoc.toggleMonospace) strictly limited to AsciiDoc documents: they are hidden from the Command Palette in other languages and now leave the document untouched when they are invoked outside AsciiDoc (#1199)
* Display images in the preview on Windows when imagesdir is an absolute path, for instance :imagesdir: {asciidoctorconfigdir}/media in .asciidoctorconfig.adoc, instead of having them blocked by the webview (#1203)
* Embed images in the preview when the data-uri attribute is set and imagesdir is an absolute path, for instance :imagesdir: {asciidoctorconfigdir}/media in .asciidoctorconfig.adoc, instead of looking for them relative to the document (#1203)
Performance
* Parse only the header of the document before converting it for the preview, instead of the whole document, which made each preview update take about twice as long as needed. The PDF export also parses only the header to find the PDF theme (#1249)
Parse each version of a document once for the outline, the folding ranges, the completion, the hover, the document links and the diagnostics, instead of once for each of them: after an edit, the extension now parses the document 3 times instead of about 7, which halves the time it spends on each edit of a large document. The parse is done again when a file is saved in VS Code; when an included file changes outside VS Code, run the new AsciiDoc: Clear Cache* command to take it into account (#1251)
* Convert the documents for the preview in a worker thread on the desktop, so that previewing a large document no longer blocks the extension host, shared with the other extensions, while the document is converted. Antora documents, and documents previewed while another installed extension contributes Asciidoctor.js extensions, are still converted in the extension host. Asciidoctor.js extensions from .asciidoctor/lib now run in this worker thread, where the VS Code API is not available (#1245)
Documentation
* Clarify that asciidoc.preview.asciidoctorAttributes does not configure the source highlighter of exports, and disable highlighting by unsetting the attribute rather than with an empty value (#1218)
Release meta
Released by: @ggrossetie
Full Changelog: https://github.com/asciidoctor/asciidoctor-vscode/compare/v4.2.2...v4.3.0
v4.2.22026-08-19
版本v4.2.2以修复为主。预览端补齐了两处渲染遗漏:mermaid代码块的标题与图注(如Figure 1. My Diagram)不再被静默丢弃;导出的HTML里Mermaid图表也与预览保持一致,此前只会留一张未渲染的图片。另一个高频体验问题是部分VS Code主题下内联代码几乎看不清,根源是文字颜色误用了适配其他背景的主题变量,现已修正。docinfo.html引用的相对资源(如<script src="…">)此前加载报403,原因是<base>标签声明晚于内容注入,顺序调整后恢复正常。此外还有一处不影响功能的改动:把asciidoctorWebViewConverter.ts里的裸NUL字节换成\x00转义,Git和GitHub不再将其误判为二进制文件。
v4.2.12026-07-31
v4.2.1新增设置asciidoc.pdf.outputPath,支持用模板自定义PDF导出的完整路径,例如${workspaceFolder}/out/${relativeFileDirnameFlat}-${fileBasenameNoExtension}.pdf。用户可据此决定输出落在源文件旁、统一存进一个平铺目录,还是按源文件结构镜像,不再受限于asciidoc.pdf.outputDirectory指定的单一目录(#1159)。修复方面,asciidoc.antora.siteManifestPath现在与其他路径设置保持一致,会解析${workspaceFolder}等VS Code路径变量;定位manifest也不再依赖工作区范围的文件搜索——此前路径位于工作区之外或被.gitignore排除时会静默失败,如今已能正常解析。
v4.2.0预发布2026-07-30
What's Changed
Changelog
Features
* Add asciidoc.antora.siteManifestPath to resolve xref: links (completion, "Go to Definition", preview) to pages published in remote-only Antora components via a site-manifest.json generated by Antora Atlas (#1181)
* Add antora and github preview styles alongside vscode/asciidoctor, selectable via the new asciidoc.preview.defaultStyle setting; the antora style is auto-selected when Antora support is active, and Mermaid diagrams now follow the resolved preview style instead of always the VS Code theme
* Improve fidelity of the new antora and github preview styles against their real-world references (Antora Default UI and github.com), covering headings, code blocks, tables, quotes, admonitions, captions and the table of contents
* Resolve VS Code path variables (${workspaceFolder}, ${userHome}, ${env:NAME}, …) consistently across preview attributes and PDF export settings, instead of only the bare ${workspaceFolder} in some places (#1154)
Bug fixes
* Fix asciidoc.extensions.registerWorkspaceExtensions failing to load workspace .asciidoctor/lib extensions since 4.0.0's move to native ESM (#1179)
* Render image::foo.svg[opts=interactive] in the preview by allow-listing it in the frame-src Content Security Policy directive
* Make asciidoc.antora.showEnableAntoraPrompt actually take effect, and show the "enable Antora support?" prompt for the document that triggered activation, not just ones opened afterward
* Keep the Antora content catalog alive when the workspace aggregates the same component version twice or declares a non-string version, instead of breaking every Antora feature
* Log Antora resolution failures (dropped/merged antora.yml files, unmatched documents) to the "Asciidoctor" output channel instead of failing silently
* Fully reload the preview when an edit changes the webview "shell" (e.g. toggling :stem: or :source-highlighter:), instead of leaving it in an inconsistent partially-updated state
* Fix STEM rendering in the preview on a machine without internet access by bundling the mhchem font extension instead of fetching it from a CDN (#1160)
Deprecations
* Deprecate asciidoc.preview.useEditorStyle in favor of asciidoc.preview.defaultStyle, which adds the new antora, github-light and github-dark styles
* Deprecate asciidoc.useWorkspaceRootAsBaseDirectory; use an .asciidoctorconfig file anchored on {asciidoctorconfigdir} instead (#1155)
Documentation
* Clarify on the Antora page that the "remote content sources" limitation only concerns Antora playbooks, not remote-development setups like VS Code Remote - SSH, and document that the enable-support prompt is opt-in
* Clarify how relative include/image paths resolve when asciidoc.useWorkspaceRootAsBaseDirectory is enabled (#700)
Infrastructure
* Migrate the codebase to TypeScript "strict": true (noImplicitAny, strictNullChecks, strictPropertyInitialization), fixing a couple of latent null-handling bugs surfaced along the way
* Fix antora.yml parsing in the web extension, where Uint8Array was passed straight to yaml.load instead of being decoded first
* Shrink the packaged VSIX from ~29 MB to ~14 MB by trimming .vscodeignore re-includes and the bundled Mermaid assets to what's actually needed at runtime
* Simplify AsciidocPreviewConfiguration.getDefaultStyle() to read resolved settings via WorkspaceConfiguration.get() instead of manually re-deriving them (no behaviour change)
* Update dependencies, notably @asciidoctor/core to 4.0.6, mermaid to 11.16.0, mathjax to 4.1.3, and js-yaml to v5
Release meta
Released by: @ggrossetie
Full Changelog: https://github.com/asciidoctor/asciidoctor-vscode/compare/v4.1.0...v4.2.0
v4.0.0预发布2026-07-07
What's Changed
Changelog
Features
* Add an "AsciiDoc: Open AsciiDoc Cheat Sheet" command that opens a concise, always-available syntax reference right inside the editor, so beginners no longer have to leave VS Code to look up the syntax (#297). The cheat sheet is authored in AsciiDoc and bundled with the extension (media/cheatsheet.adoc), then rendered through the regular preview pipeline — so it stays in sync with what the extension can actually render (dogfooding) and needs no bespoke viewer. It opens as a locked preview to the side, which keeps it pinned in place instead of being hijacked by whichever document is edited next. The command is available from the command palette even when no AsciiDoc file is open, so it works as a discoverable entry point to the syntax. Because the source is plain AsciiDoc, contributing to the reference is as simple as editing that file
* Surface a one-time notification when a previewed document contains a diagram that Kroki could render while the Kroki extension is disabled (#480). Kroki rendering is off by default — it sends the diagram source to a server — so diagrams stay unrendered until it is explicitly enabled, and users had no way to discover that the extension can render them at all. The preview now detects a Kroki-renderable diagram block (any of the asciidoctor-kroki block styles or block macros — [plantuml], plantuml::…[], [graphviz], [d2], … — Mermaid excluded, as it is always rendered) through a cheap textual scan and shows a single, non-recurring notification offering to "Enable Kroki" or to open the documentation. Enabling remains an explicit opt-in (nothing is sent anywhere on its own): choosing "Enable Kroki" flips asciidoc.extensions.enableKroki on and refreshes the preview so the diagrams render immediately. The hint is shown at most once ever (tracked in the extension's global state) and never while Kroki is already enabled
* Add an asciidoc.extensions.kroki.serverUrl setting to point the Kroki diagram extension at a specific server — typically a self-hosted instance such as http://localhost:8000 — without editing every document (#480). Previously the server could only be chosen through the kroki-server-url attribute (in the document header or an .asciidoctorconfig file); many users need a private Kroki server for confidentiality reasons and asked for a discoverable, workspace-wide setting like the IntelliJ AsciiDoc plugin offers. The setting is applied as a soft default, so it sits at the bottom of the usual "closer to the document wins" precedence chain: a kroki-server-url set in the document header takes precedence over one in the nearest .asciidoctorconfig, which takes precedence over the setting, which itself falls back to the public https://kroki.io server when left empty. The resolved URL is also added to the preview's Content Security Policy allow-list (from a header parse that now applies .asciidoctorconfig too), so diagrams served from a non-https: server such as http://localhost:8000 — which the CSP's blanket https: rule does not cover — are no longer blocked. The setting is resource-scoped, so it can be overridden per workspace folder, and it applies to the preview as well as the HTML/PDF/DocBook exports. Documented on the "Diagram integration" and "Settings" pages
Pick up an .asciidoctorconfig (or .asciidoctorconfig.adoc) sitting at the root of the other* workspace folders in a multi-root workspace (#766). Previously the configuration lookup only walked from the document up to the root of the workspace folder containing it, so a configuration file kept in a separate workspace folder (e.g. a folder dedicated to shared .asciidoctorconfig and docinfo assets) was never found. The roots of the other workspace folders are now scanned as the most general configuration — applied before the document's own folder chain, so anything defined closer to the document still takes precedence — restoring the pre-2.9 ability to share one configuration across several roots. Single-folder workspaces and loose files are unaffected. The recommended, portable way to reference assets from a configuration file remains the built-in {asciidoctorconfigdir} attribute (it resolves to the directory of the config file and keeps working across editors and the Asciidoctor CLI), rather than an editor-specific ${workspaceFolder} variable. The .asciidoctorconfig feature is now fully documented (discovery order and precedence, multi-root behaviour, {asciidoctorconfigdir}, and per-profile switching with ifdef/ifndef in a .asciidoctorconfig.adoc)
* Add a right-click context menu in the preview exposing the document export commands — "Save HTML", "Export Document as PDF" and "Save to DocBook" (#832). The menu is contributed through VS Code's webview/context extension point, gated on the preview's view type; the previewed <body> carries a data-vscode-context marker so the export commands target the document backing the focused preview rather than the (possibly unrelated) active text editor. Document resolution falls back to the active editor when a command is run from the editor title, the editor or the command palette, preserving the previous behaviour. The menu entries are hidden in the web extension, where the export commands rely on the local filesystem. VS Code's native Cut/Copy/Paste entries are suppressed (preventDefaultContextMenuItems): Cut and Paste are meaningless in a read-only preview, and copying remains available through <kbd>Ctrl</kbd>/<kbd>Cmd</kbd>+<kbd>C</kbd> — VS Code offers no way to keep only Copy (microsoft/vscode#165679)
Add keyboard shortcuts to toggle inline formatting in the editor (#975): <kbd>Ctrl</kbd>/<kbd>Cmd</kbd>+<kbd>B</kbd> for bold (…), <kbd>Ctrl</kbd>/<kbd>Cmd</kbd>+<kbd>I</kbd> for italic (…) and <kbd>Ctrl</kbd>/<kbd>Cmd</kbd>+<kbd>M</kbd> for monospace (` … ), plus the matching "AsciiDoc: Toggle Bold/Italic/Monospace" commands. Each shortcut wraps the selection, unwraps it again when it is already wrapped (toggle off), wraps the word under the cursor when nothing is selected, or inserts an empty marker pair with the cursor between the markers. AsciiDoc's two formatting forms are honoured: the constrained single marker (bold) is used at word boundaries and the unconstrained doubled marker (bold) when the selection is glued to a word (e.g. mid-word foob**ar); toggling off recognises either form, whether the marks are inside the selection or immediately around it, and leading/trailing whitespace is kept outside the marks. The bindings only apply while editing an AsciiDoc document
Make custom converter templates work in the preview, resolve relative asciidoc.preview.templates paths, and auto-discover a .asciidoctor/templates directory (#777, #843). Three things were broken. (1) Templates were never applied to the preview at all: the preview's custom webview-html5 converter advertised template support through the legacy supportstemplates property, but Asciidoctor.js 4.0 only builds the composite (template + backend) converter when the backend converter answers a hasSupportsTemplates() method — so template_dirs was silently ignored and every node kept its default rendering. The converter now implements the 4.0 template-composition API (hasSupportsTemplates(), handles() and backendInfo()), letting user templates override individual node transforms in the preview (the export path already worked, as it uses the built-in HTML5 converter). (2) The setting has always documented that relative paths are interpreted relative to the folder open in the Explorer (or, failing that, the document's directory), but the configured values were passed to Asciidoctor verbatim — so a relative path such as templates` was resolved against the process working directory and never found. Relative entries are now resolved against the document's workspace folder root (or the document's o
v3.4.52025-09-16
v3.4.5以修复为主:交叉引用(xref)与图片引用的补全建议更准确,此前下划线会被转义导致锚点跳转失败,现在带下划线的标题锚点可以正常导航;源码块的TextMate语法规则也做了调整,高亮更贴合实际写法。
底层同步升级:改用官方推荐的vscode-l10n替代已废弃的vscode-nls,Node升至v22,静态检查工具由ESLint换成Biome,构建与维护流程更轻。功能行为无其他变化。
v3.4.42025-07-15
v3.4.4是一次小版本修复,只动了一处逻辑:扩展此前只要判断项目可能用到Antora,就会弹出启用Antora支持的提示,哪怕目录里根本没有antora.yml。现在这条询问只在检测到该配置文件后才出现,普通AsciiDoc文档项目不会再被无关提示打断。对不用Antora搭建文档站点的用户来说,升级后弹窗会明显变少,其余行为与v3.4.2保持一致。
v3.4.22024-11-01
v3.4.2发布,本次只有一项修复:搜索功能改用VS Code内置的workspace.findFiles,不再依赖ripgrep。ripgrep是3.4.0引入的,上线后暴露出较多兼容性与稳定性问题,导致部分环境下搜索异常或卡顿,回退到官方API后这些问题应当消失,升级即可生效。
v3.4.12024-10-12
Asciidoctor VS Code扩展v3.4.1发布,本次仅含一项修复:ripgrep搜索改用VS Code自带安装目录中的rg二进制,不再依赖系统PATH里的版本。此前在未安装ripgrep或版本不匹配的机器上,搜索与索引功能可能直接报错,更新后各平台行为会更稳定,也不会因用户环境差异而出现结果不一致。除这一处外没有其他改动,属于维护性小版本。
v3.4.02024-10-11
v3.4.0主要修了预览渲染的几个坑,同时补上了一批AsciiDoc内置属性。预览端修复了xrefstyle样式不被采纳的问题,以及文档被include后文档间交叉引用失效的毛病;表格分隔符后面现在也允许出现空格。功能上补齐了docdir、docfile、docname等内置属性,新增docfilesuffix与filetype;Antora支持改为通过命令启用或关闭,不再依赖配置猜测。性能方面用ripgrep替代findFiles,文件搜索明显提速。另外,替换了VS Code不支持的动态导入写法,避免相关功能在扩展环境中失效。