Skip to content

Commit 32362d9

Browse files
yotsudaclaude
andcommitted
Disable implicit_figures in all Pandoc calls to suppress image captions
Unify Pandoc input format to markdown-implicit_figures across docx export, pptx slide preview, and MCP fallback. This prevents alt text from appearing as italic captions below images. Remove the now-unnecessary figcaption stripping regex from SlideService. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d900298 commit 32362d9

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

MarkdownPointer.Mcp/Tools/MarkdownPointerTools.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public async Task<string> ExportDocument(
237237
StartInfo = new ProcessStartInfo
238238
{
239239
FileName = "pandoc",
240-
Arguments = $"-f markdown -t docx {refDoc}-o \"{outputPath}\" \"{fullPath}\"",
240+
Arguments = $"-f markdown-implicit_figures -t docx {refDoc}-o \"{outputPath}\" \"{fullPath}\"",
241241
UseShellExecute = false,
242242
CreateNoWindow = true,
243243
RedirectStandardError = true

MarkdownPointer/Services/PandocService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static class PandocService
3535
StartInfo = new ProcessStartInfo
3636
{
3737
FileName = "pandoc",
38-
Arguments = $"-f markdown -t {format} {refDoc}{resPath}-o \"{outputPath}\" \"{markdownPath}\"",
38+
Arguments = $"-f markdown-implicit_figures -t {format} {refDoc}{resPath}-o \"{outputPath}\" \"{markdownPath}\"",
3939
UseShellExecute = false,
4040
CreateNoWindow = true,
4141
RedirectStandardError = true

MarkdownPointer/Services/SlideService.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ public static class SlideService
3333

3434
// Pandoc uses data-src for lazy loading in reveal.js; convert to src for WebView2
3535
html = html.Replace("data-src=\"", "src=\"");
36-
// Remove figcaption elements (Pandoc wraps images in <figure> with alt text as caption)
37-
html = Regex.Replace(html, @"<figcaption[^>]*>.*?</figcaption>", "", RegexOptions.Singleline);
3836

3937
// Inline local images as base64 (NavigateToString blocks file:// access)
4038
var baseDir = Path.GetDirectoryName(markdownPath)!;
@@ -82,7 +80,7 @@ public static class SlideService
8280
var psi = new ProcessStartInfo
8381
{
8482
FileName = "pandoc",
85-
Arguments = $"-f markdown -t revealjs -s " +
83+
Arguments = $"-f markdown-implicit_figures -t revealjs -s " +
8684
$"--variable revealjs-url=https://cdn.jsdelivr.net/npm/reveal.js@5.2.1 " +
8785
$"--variable theme={theme} " +
8886
$"-o \"{outputPath}\" \"{markdownPath}\"",

0 commit comments

Comments
 (0)