8 Commits
Author SHA1 Message Date
AlexKucera 75d6f3d002 Merge branch 'release/1.2.1' 2025-09-10 23:00:56 +02:00
Jarvis 9f1670a224 chore: release 1.2.1
🚀 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 22:59:58 +02:00
Jarvis 034d4ffba4 fix: resolve horizontal rule YAML parsing conflicts
Fixes issue where horizontal rules (---) in markdown were causing
"Error parsing YAML metadata" when exporting to PDF via Pandoc.

Changes:
- Add HorizontalRuleProcessor to transform --- to *** before Pandoc
- Preserve YAML frontmatter by detecting and skipping frontmatter sections
- Add horizontalrule definition to all Typst templates for Pandoc compatibility
- Update universal wrapper to import horizontalrule from templates
- Clean up PandocTypstConverter formatting and remove debug output

The processor now detects YAML frontmatter patterns and only transforms
horizontal rules in content body, preventing destruction of document
frontmatter while resolving Pandoc parsing conflicts.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 22:51:10 +02:00
Jarvis 7f54320e4c fix: resolve TypeScript build errors introduced in c13e48a
Fixes 23 TypeScript errors in 8 files by properly handling type assertions
and template variable types:

**DataAdapter Casting Issues (8 fixes):**
- Use double assertion `as unknown as { basePath: string }` instead of
  direct casting to avoid TypeScript's type overlap validation
- Files: BinaryLocator, ExportOrchestrator, PathResolver, PluginLifecycle, TemplateManager

**Template Variables Type Issues (15 fixes):**
- Add `undefined` to Record<string, string|number|boolean> union type
- Convert template variable values to appropriate types before passing to UI methods:
  - String() for dropdown setValue() methods
  - Number() for slider setValue() methods
- Update interface definitions in modalTypes.ts and ModalState.ts

The double assertion pattern is required because basePath exists at runtime
in Obsidian's FileSystemAdapter but isn't in the TypeScript definitions.
Adding undefined to template variables properly handles uninitialized values.

All changes maintain full functionality while ensuring type safety.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 22:01:16 +02:00
AlexKucera 473f8e80a6 Merge branch 'master' into develop 2025-09-10 18:04:41 +02:00
Jarvis c13e48a615 refactor: replace explicit any types for Obsidian plugin review compliance
Replace all @typescript-eslint/no-explicit-any warnings with proper type assertions
and union types to meet Obsidian plugin review requirements.

Changes:
- Replace (adapter as any).basePath with (adapter as { basePath: string }).basePath
- Change template variable types from Record<string, any> to Record<string, string | number | boolean>
- Change frontmatter types from Record<string, any> to Record<string, unknown>
- Fix error handling in PdfCliExecutor with proper type assertion
- Update method signatures in TypstVariableMapper for type safety

This eliminates all 42 @typescript-eslint/no-explicit-any warnings while
maintaining full functionality and improving type safety.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 18:04:29 +02:00
AlexKucera 80fecbfab2 Merge branch 'master' into develop 2025-09-10 17:47:52 +02:00
AlexKucera 2a23bef0f9 Merge branch 'release/1.2.0' into develop 2025-09-10 16:58:35 +02:00
29 changed files with 391 additions and 245 deletions

No files matched your search

+2 -2
View File
@@ -125,7 +125,7 @@ jobs:
## Installation ## Installation
### Automatic Installation (Community Plugins) ### Automatic Installation (Community Plugins) - Plugin still waiting for approval
Search for "Typst PDF Export" in Obsidian's Community Plugins tab. Search for "Typst PDF Export" in Obsidian's Community Plugins tab.
### Manual Installation ### Manual Installation
@@ -138,7 +138,7 @@ jobs:
### Requirements ### Requirements
- [Pandoc](https://pandoc.org/installing.html) - [Pandoc](https://pandoc.org/installing.html)
- [Typst](https://typst.app/docs/installation/) - [Typst](https://typst.app/docs/installation/)
- ImageMagick (optional, for enhanced image processing) - [ImageMagick](https://imagemagick.org) (for enhanced image processing)
## Files in this release ## Files in this release
- `main.js` - Plugin code with embedded templates - `main.js` - Plugin code with embedded templates
+17
View File
@@ -5,6 +5,23 @@ All notable changes to the Obsidian Typst PDF Export plugin will be documented i
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.2.1] - 2025-01-10
### Fixed
- **Horizontal Rule Processing**: Resolved YAML parsing conflicts when documents contain horizontal rules (`---`)
- Added HorizontalRuleProcessor to transform horizontal rules to asterisks (`***`) before Pandoc processing
- Preserved YAML frontmatter by detecting and skipping frontmatter sections during transformation
- Added horizontalrule definition to all Typst templates for Pandoc compatibility
- **TypeScript Build Errors**: Fixed 23 TypeScript errors in 8 files
- Resolved DataAdapter casting issues with proper type assertions
- Fixed template variable type issues by adding undefined to union types
- Ensured type safety while maintaining full functionality
### Changed
- **Code Quality**: Replaced explicit any types for Obsidian plugin review compliance
- Improved type safety throughout the codebase
- Enhanced code maintainability with proper type assertions
## [1.2.0] - 2025-01-10 ## [1.2.0] - 2025-01-10
### Changed ### Changed
+1 -1
View File
@@ -48,7 +48,7 @@ Typst offers several advantages over standard PDF export:
## Installation ## Installation
### Method 1: Community Plugin Store (Recommended) ### Method 1: Community Plugin Store (Recommended) - Still waiting on plugin approval
1. Open **Settings** → **Community Plugins** 1. Open **Settings** → **Community Plugins**
2. **Disable Safe Mode** if needed 2. **Disable Safe Mode** if needed
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"id": "typst-pdf-export", "id": "typst-pdf-export",
"name": "Typst PDF Export", "name": "Typst PDF Export",
"version": "1.2.0", "version": "1.2.1",
"minAppVersion": "1.9.12", "minAppVersion": "1.9.12",
"description": "Exports a note or collection of notes to a pretty Typst PDF.", "description": "Exports a note or collection of notes to a pretty Typst PDF.",
"author": "Alexander Kucera", "author": "Alexander Kucera",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "obsidian-typst-pdf-export", "name": "obsidian-typst-pdf-export",
"version": "1.2.0", "version": "1.2.1",
"description": "Exports a note or collection of notes to a pretty Typst PDF.", "description": "Exports a note or collection of notes to a pretty Typst PDF.",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {
+14 -7
View File
@@ -8,6 +8,7 @@ import { WikilinkProcessor, WikilinkConfig, WikilinkProcessorConfig } from './pr
import { EmbedProcessor, EmbedProcessorConfig } from './preprocessors/EmbedProcessor'; import { EmbedProcessor, EmbedProcessorConfig } from './preprocessors/EmbedProcessor';
import { CalloutProcessor } from './preprocessors/CalloutProcessor'; import { CalloutProcessor } from './preprocessors/CalloutProcessor';
import { MetadataExtractor } from './preprocessors/MetadataExtractor'; import { MetadataExtractor } from './preprocessors/MetadataExtractor';
import { HorizontalRuleProcessor } from './preprocessors/HorizontalRuleProcessor';
export interface PreprocessorOptions { export interface PreprocessorOptions {
/** Preserve existing frontmatter */ /** Preserve existing frontmatter */
@@ -25,7 +26,7 @@ export interface PreprocessingResult {
/** Extracted metadata including tags and frontmatter */ /** Extracted metadata including tags and frontmatter */
metadata: { metadata: {
tags: string[]; tags: string[];
frontmatter?: Record<string, any>; frontmatter?: Record<string, unknown>;
title?: string; title?: string;
pdfEmbeds?: Array<{ pdfEmbeds?: Array<{
originalPath: string; originalPath: string;
@@ -75,6 +76,7 @@ export class MarkdownPreprocessor {
private options: PreprocessorOptions; private options: PreprocessorOptions;
private wikilinkConfig: WikilinkConfig; private wikilinkConfig: WikilinkConfig;
private noteTitle?: string; private noteTitle?: string;
private horizontalRuleProcessor: HorizontalRuleProcessor;
private frontmatterProcessor: FrontmatterProcessor; private frontmatterProcessor: FrontmatterProcessor;
private wikilinkProcessor: WikilinkProcessor; private wikilinkProcessor: WikilinkProcessor;
private embedProcessor: EmbedProcessor; private embedProcessor: EmbedProcessor;
@@ -86,6 +88,8 @@ export class MarkdownPreprocessor {
this.wikilinkConfig = config.wikilinkConfig; this.wikilinkConfig = config.wikilinkConfig;
this.noteTitle = config.noteTitle; this.noteTitle = config.noteTitle;
this.horizontalRuleProcessor = new HorizontalRuleProcessor();
const frontmatterConfig: FrontmatterProcessorConfig = { const frontmatterConfig: FrontmatterProcessorConfig = {
noteTitle: this.noteTitle, noteTitle: this.noteTitle,
preserveFrontmatter: this.options.preserveFrontmatter, preserveFrontmatter: this.options.preserveFrontmatter,
@@ -123,22 +127,25 @@ export class MarkdownPreprocessor {
}; };
try { try {
// Step 1: Extract and process frontmatter first (always process for metadata extraction) // Step 1: Process horizontal rules to avoid YAML delimiter conflicts
result.content = this.horizontalRuleProcessor.process(result.content);
// Step 2: Extract and process frontmatter (always process for metadata extraction)
result.content = this.frontmatterProcessor.processFrontmatter(result.content, result); result.content = this.frontmatterProcessor.processFrontmatter(result.content, result);
// Step 2: Convert email blocks to Typst format // Step 3: Convert email blocks to Typst format
result.content = this.calloutProcessor.processEmailBlocks(result.content, result); result.content = this.calloutProcessor.processEmailBlocks(result.content, result);
// Step 3: Filter out unnecessary links (Open: links and Mail.app links) // Step 4: Filter out unnecessary links (Open: links and Mail.app links)
result.content = this.calloutProcessor.filterUnnecessaryLinks(result.content, result); result.content = this.calloutProcessor.filterUnnecessaryLinks(result.content, result);
// Step 4: Convert embeds FIRST (before wikilinks to avoid .md extension being added) // Step 5: Convert embeds FIRST (before wikilinks to avoid .md extension being added)
result.content = this.embedProcessor.processEmbeds(result.content, result); result.content = this.embedProcessor.processEmbeds(result.content, result);
// Step 5: Convert wikilinks (after embeds are processed) // Step 6: Convert wikilinks (after embeds are processed)
result.content = this.wikilinkProcessor.processWikilinks(result.content, result); result.content = this.wikilinkProcessor.processWikilinks(result.content, result);
// Step 6: Convert callouts // Step 7: Convert callouts
result.content = this.calloutProcessor.processCallouts(result.content, result); result.content = this.calloutProcessor.processCallouts(result.content, result);
// Extract title from content if not available from frontmatter // Extract title from content if not available from frontmatter
+32 -32
View File
@@ -94,42 +94,42 @@ export class PandocTypstConverter {
* Convert markdown content to PDF * Convert markdown content to PDF
*/ */
async convertMarkdownToPDF( async convertMarkdownToPDF(
content: string, content: string,
outputPath: string, outputPath: string,
options: Partial<PandocOptions> = {}, options: Partial<PandocOptions> = {},
progressCallback?: ProgressCallback progressCallback?: ProgressCallback
): Promise<ConversionResult> { ): Promise<ConversionResult> {
try {
progressCallback?.('Preparing markdown content...', 10);
// Create temporary markdown file
await this.ensureTempDirectory();
const tempInputPath = path.join(this.tempDir!, `temp-${Date.now()}.md`);
await fsPromises.writeFile(tempInputPath, content, 'utf-8');
// Merge options
this.pandocOptions = { ...this.pandocOptions, ...options };
// Convert using the file-based method
const result = await this.convertToPDF(tempInputPath, outputPath, progressCallback);
// Cleanup temp file
try { try {
progressCallback?.('Preparing markdown content...', 10); await fsPromises.unlink(tempInputPath);
// Create temporary markdown file
await this.ensureTempDirectory();
const tempInputPath = path.join(this.tempDir!, `temp-${Date.now()}.md`);
await fsPromises.writeFile(tempInputPath, content, 'utf-8');
// Merge options
this.pandocOptions = { ...this.pandocOptions, ...options };
// Convert using the file-based method
const result = await this.convertToPDF(tempInputPath, outputPath, progressCallback);
// Cleanup temp file
try {
await fsPromises.unlink(tempInputPath);
} catch (error) {
console.warn('Failed to cleanup temp file:', error);
}
return result;
} catch (error) { } catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error); console.warn('Failed to cleanup temp file:', error);
return {
success: false,
error: `Conversion failed: ${errorMessage}`
};
} }
return result;
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);
return {
success: false,
error: `Conversion failed: ${errorMessage}`
};
} }
}
/** /**
* Set up cleanup handlers for temporary files * Set up cleanup handlers for temporary files
+3 -3
View File
@@ -145,7 +145,7 @@ export class TypstVariableMapper {
/** /**
* Map typography settings to Typst variables * Map typography settings to Typst variables
*/ */
private mapTypographyVariables(settings: obsidianTypstPDFExportSettings, existingVars: Record<string, any>): TypstVariable[] { private mapTypographyVariables(settings: obsidianTypstPDFExportSettings, existingVars: Record<string, string | number | boolean>): TypstVariable[] {
const variables: TypstVariable[] = []; const variables: TypstVariable[] = [];
if (!settings.typography) { if (!settings.typography) {
@@ -191,7 +191,7 @@ export class TypstVariableMapper {
/** /**
* Map page setup settings to Typst variables * Map page setup settings to Typst variables
*/ */
private mapPageSetupVariables(settings: obsidianTypstPDFExportSettings, existingVars: Record<string, any>): TypstVariable[] { private mapPageSetupVariables(settings: obsidianTypstPDFExportSettings, existingVars: Record<string, string | number | boolean>): TypstVariable[] {
const variables: TypstVariable[] = []; const variables: TypstVariable[] = [];
if (!settings.pageSetup) { if (!settings.pageSetup) {
@@ -226,7 +226,7 @@ export class TypstVariableMapper {
/** /**
* Map margin settings to Typst variables * Map margin settings to Typst variables
*/ */
private mapMarginVariables(margins: {top: number; right: number; bottom: number; left: number;}, existingVars: Record<string, any>): TypstVariable[] { private mapMarginVariables(margins: {top: number; right: number; bottom: number; left: number;}, existingVars: Record<string, string | number | boolean>): TypstVariable[] {
const variables: TypstVariable[] = []; const variables: TypstVariable[] = [];
if (!existingVars.marginTop && !existingVars.margin_top && margins.top !== undefined) { if (!existingVars.marginTop && !existingVars.margin_top && margins.top !== undefined) {
+1 -1
View File
@@ -83,7 +83,7 @@ export class BinaryLocator {
// Strategy 2: Assuming we're running from vault root // Strategy 2: Assuming we're running from vault root
path.join(configDir, 'plugins', pluginDirName), path.join(configDir, 'plugins', pluginDirName),
// Strategy 3: From vault base path if plugin is available // Strategy 3: From vault base path if plugin is available
...(plugin ? [path.join((plugin.app.vault.adapter as any).basePath, plugin.manifest.dir!)] : []) ...(plugin ? [path.join((plugin.app.vault.adapter as unknown as { basePath: string }).basePath, plugin.manifest.dir!)] : [])
]; ];
} }
+1 -1
View File
@@ -137,7 +137,7 @@ export class PdfCliExecutor {
return { return {
success: false, success: false,
error: `PDF CLI conversion failed: ${errorMessage}`, error: `PDF CLI conversion failed: ${errorMessage}`,
stderr: (cliError as any)?.stderr || '' stderr: (cliError as { stderr?: string })?.stderr || ''
}; };
} }
} }
@@ -17,7 +17,7 @@ export interface PreprocessingResult {
/** Extracted metadata including tags and frontmatter */ /** Extracted metadata including tags and frontmatter */
metadata: { metadata: {
tags: string[]; tags: string[];
frontmatter?: Record<string, any>; frontmatter?: Record<string, unknown>;
title?: string; title?: string;
pdfEmbeds?: Array<{ pdfEmbeds?: Array<{
originalPath: string; originalPath: string;
@@ -27,193 +27,225 @@ export class FrontmatterProcessor {
* Process frontmatter using the gray-matter library approach * Process frontmatter using the gray-matter library approach
*/ */
public processFrontmatter(content: string, result: PreprocessingResult): string { public processFrontmatter(content: string, result: PreprocessingResult): string {
try { try {
// Use gray-matter for robust frontmatter parsing // Check if content actually has frontmatter before trying to parse
const matter = require('gray-matter'); if (!this.FRONTMATTER_PATTERN.test(content)) {
const parsed = matter(content); // No frontmatter found - add title frontmatter if we have a noteTitle
if (this.noteTitle) {
if (parsed.data && Object.keys(parsed.data).length > 0) { const yaml = require('js-yaml');
// Replace frontmatter title with filename if noteTitle is provided const titleFrontmatter = yaml.dump({ title: this.noteTitle });
if (this.noteTitle) { result.metadata.title = this.noteTitle;
const frontmatterCopy = { ...parsed.data }; result.metadata.frontmatter = { title: this.noteTitle };
frontmatterCopy.title = this.noteTitle; return `---\n${titleFrontmatter}---\n${content}`;
result.metadata.frontmatter = frontmatterCopy;
} else {
result.metadata.frontmatter = parsed.data;
}
// Extract tags from frontmatter if they exist
if (parsed.data.tags) {
let frontmatterTags: string[] = [];
if (Array.isArray(parsed.data.tags)) {
// Handle array of tags
frontmatterTags = parsed.data.tags
.map((tag: unknown) => typeof tag === 'string' ? tag : String(tag))
.filter((tag: string) => tag.trim() !== '');
} else if (typeof parsed.data.tags === 'string') {
// Handle comma-separated string or single tag
frontmatterTags = parsed.data.tags
.split(/[,\s]+/)
.map((tag: string) => tag.trim())
.filter((tag: string) => tag !== '');
}
// Merge with existing tags (avoid duplicates)
for (const tag of frontmatterTags) {
if (!result.metadata.tags.includes(tag)) {
result.metadata.tags.push(tag);
}
}
}
// Extract title - use noteTitle if available, otherwise frontmatter title
if (this.noteTitle) {
result.metadata.title = this.noteTitle;
} else if (parsed.data.title && typeof parsed.data.title === 'string') {
result.metadata.title = parsed.data.title.trim();
}
// Handle frontmatter preservation and display options
const finalFrontmatter = this.noteTitle ?
{ ...parsed.data, title: this.noteTitle } :
parsed.data;
if (this.preserveFrontmatter) {
// Keep the frontmatter in the content, but reconstruct it with the modified title
const yaml = require('js-yaml');
const newFrontmatter = yaml.dump(finalFrontmatter);
let processedContent = `---\n${newFrontmatter}---\n${parsed.content}`;
// Add printed frontmatter if requested
if (this.printFrontmatter) {
const frontmatterDisplay = this.formatFrontmatterForDisplay(finalFrontmatter);
processedContent = `---\n${newFrontmatter}---\n\n${frontmatterDisplay}\n\n${parsed.content}`;
}
return processedContent;
} else {
// Return content without frontmatter, but add title as frontmatter for Pandoc
let processedContent: string;
if (this.noteTitle) {
const yaml = require('js-yaml');
const titleFrontmatter = yaml.dump({ title: this.noteTitle });
processedContent = `---\n${titleFrontmatter}---\n${parsed.content}`;
} else {
processedContent = parsed.content;
}
// Add printed frontmatter if requested
if (this.printFrontmatter) {
const frontmatterDisplay = this.formatFrontmatterForDisplay(finalFrontmatter);
// Insert after the title frontmatter but before content
const lines = processedContent.split('\n');
if (lines[0] === '---' && lines.findIndex(line => line === '---') > 0) {
const endIndex = lines.findIndex((line, i) => i > 0 && line === '---');
lines.splice(endIndex + 1, 0, '', frontmatterDisplay, '');
processedContent = lines.join('\n');
} else {
processedContent = `${frontmatterDisplay}\n\n${processedContent}`;
}
}
return processedContent;
}
} else { } else {
// No frontmatter found - add title frontmatter if we have a noteTitle return content;
}
}
// Use gray-matter for robust frontmatter parsing
const matter = require('gray-matter');
// Add debugging to see what's being parsed
console.log('FrontmatterProcessor: Attempting to parse content with frontmatter pattern detected');
console.log('First 200 chars:', content.substring(0, 200));
const parsed = matter(content);
if (parsed.data && Object.keys(parsed.data).length > 0) {
// Replace frontmatter title with filename if noteTitle is provided
if (this.noteTitle) {
const frontmatterCopy = { ...parsed.data };
frontmatterCopy.title = this.noteTitle;
result.metadata.frontmatter = frontmatterCopy;
} else {
result.metadata.frontmatter = parsed.data;
}
// Extract tags from frontmatter if they exist
if (parsed.data.tags) {
let frontmatterTags: string[] = [];
if (Array.isArray(parsed.data.tags)) {
// Handle array of tags
frontmatterTags = parsed.data.tags
.map((tag: unknown) => typeof tag === 'string' ? tag : String(tag))
.filter((tag: string) => tag.trim() !== '');
} else if (typeof parsed.data.tags === 'string') {
// Handle comma-separated string or single tag
frontmatterTags = parsed.data.tags
.split(/[,\s]+/)
.map((tag: string) => tag.trim())
.filter((tag: string) => tag !== '');
}
// Merge with existing tags (avoid duplicates)
for (const tag of frontmatterTags) {
if (!result.metadata.tags.includes(tag)) {
result.metadata.tags.push(tag);
}
}
}
// Extract title - use noteTitle if available, otherwise frontmatter title
if (this.noteTitle) {
result.metadata.title = this.noteTitle;
} else if (parsed.data.title && typeof parsed.data.title === 'string') {
result.metadata.title = parsed.data.title.trim();
}
// Handle frontmatter preservation and display options
const finalFrontmatter = this.noteTitle ?
{ ...parsed.data, title: this.noteTitle } :
parsed.data;
if (this.preserveFrontmatter) {
// Keep the frontmatter in the content, but reconstruct it with the modified title
const yaml = require('js-yaml');
const newFrontmatter = yaml.dump(finalFrontmatter);
let processedContent = `---\n${newFrontmatter}---\n${parsed.content}`;
// Add printed frontmatter if requested
if (this.printFrontmatter) {
const frontmatterDisplay = this.formatFrontmatterForDisplay(finalFrontmatter);
processedContent = `---\n${newFrontmatter}---\n\n${frontmatterDisplay}\n\n${parsed.content}`;
}
return processedContent;
} else {
// Return content without frontmatter, but add title as frontmatter for Pandoc
let processedContent: string;
if (this.noteTitle) { if (this.noteTitle) {
const yaml = require('js-yaml'); const yaml = require('js-yaml');
const titleFrontmatter = yaml.dump({ title: this.noteTitle }); const titleFrontmatter = yaml.dump({ title: this.noteTitle });
return `---\n${titleFrontmatter}---\n${content}`; processedContent = `---\n${titleFrontmatter}---\n${parsed.content}`;
} else { } else {
return content; processedContent = parsed.content;
} }
}
} catch (error: unknown) {
const errorMessage = error instanceof Error ? error.message : String(error);
result.warnings.push(`Failed to parse frontmatter with gray-matter: ${errorMessage}`);
// Fallback to simple regex-based parsing // Add printed frontmatter if requested
const frontmatterMatch = content.match(this.FRONTMATTER_PATTERN); if (this.printFrontmatter) {
const frontmatterDisplay = this.formatFrontmatterForDisplay(finalFrontmatter);
if (frontmatterMatch) { // Insert after the title frontmatter but before content
try { const lines = processedContent.split('\n');
const yamlContent = frontmatterMatch[1]; if (lines[0] === '---' && lines.findIndex(line => line === '---') > 0) {
const frontmatter: Record<string, unknown> = {}; const endIndex = lines.findIndex((line, i) => i > 0 && line === '---');
lines.splice(endIndex + 1, 0, '', frontmatterDisplay, '');
const lines = yamlContent.split('\n'); processedContent = lines.join('\n');
for (const line of lines) {
const colonIndex = line.indexOf(':');
if (colonIndex > 0) {
const key = line.substring(0, colonIndex).trim();
const value = line.substring(colonIndex + 1).trim();
const cleanValue = value.replace(/^["']|["']$/g, '');
frontmatter[key] = cleanValue;
}
}
// Replace title with noteTitle if provided
if (this.noteTitle) {
frontmatter.title = this.noteTitle;
}
result.metadata.frontmatter = frontmatter;
if (this.preserveFrontmatter) {
// Reconstruct frontmatter with modified title
if (this.noteTitle) {
const yaml = require('js-yaml');
const newFrontmatter = yaml.dump(frontmatter);
let processedContent = content.replace(this.FRONTMATTER_PATTERN, `---\n${newFrontmatter}---\n`);
// Add printed frontmatter if requested
if (this.printFrontmatter) {
const frontmatterDisplay = this.formatFrontmatterForDisplay(frontmatter);
processedContent = processedContent.replace(
this.FRONTMATTER_PATTERN,
`---\n${newFrontmatter}---\n\n${frontmatterDisplay}\n\n`
);
}
return processedContent;
} else {
return content;
}
} else { } else {
// Add title as frontmatter for Pandoc even when not preserving original processedContent = `${frontmatterDisplay}\n\n${processedContent}`;
if (this.noteTitle) {
const yaml = require('js-yaml');
const titleFrontmatter = yaml.dump({ title: this.noteTitle });
let processedContent = content.replace(this.FRONTMATTER_PATTERN, `---\n${titleFrontmatter}---\n`);
// Add printed frontmatter if requested
if (this.printFrontmatter) {
const frontmatterDisplay = this.formatFrontmatterForDisplay(frontmatter);
processedContent = processedContent.replace(
this.FRONTMATTER_PATTERN,
`---\n${titleFrontmatter}---\n\n${frontmatterDisplay}\n\n`
);
}
return processedContent;
} else {
return content.replace(this.FRONTMATTER_PATTERN, '');
}
} }
} catch (fallbackError: unknown) {
const fallbackErrorMessage = fallbackError instanceof Error ? fallbackError.message : String(fallbackError);
result.warnings.push(`Fallback frontmatter parsing also failed: ${fallbackErrorMessage}`);
} }
}
return content; return processedContent;
}
} else {
// No frontmatter found - add title frontmatter if we have a noteTitle
if (this.noteTitle) {
const yaml = require('js-yaml');
const titleFrontmatter = yaml.dump({ title: this.noteTitle });
result.metadata.title = this.noteTitle;
result.metadata.frontmatter = { title: this.noteTitle };
return `---\n${titleFrontmatter}---\n${content}`;
} else {
return content;
}
} }
} catch (error: unknown) {
const errorMessage = error instanceof Error ? error.message : String(error);
console.log('FrontmatterProcessor: gray-matter failed with error:', errorMessage);
console.log('Content being parsed (first 500 chars):', content.substring(0, 500));
result.warnings.push(`Failed to parse frontmatter with gray-matter: ${errorMessage}`);
// Fallback to simple regex-based parsing
const frontmatterMatch = content.match(this.FRONTMATTER_PATTERN);
if (frontmatterMatch) {
try {
const yamlContent = frontmatterMatch[1];
const frontmatter: Record<string, unknown> = {};
const lines = yamlContent.split('\n');
for (const line of lines) {
const colonIndex = line.indexOf(':');
if (colonIndex > 0) {
const key = line.substring(0, colonIndex).trim();
const value = line.substring(colonIndex + 1).trim();
const cleanValue = value.replace(/^["']|["']$/g, '');
frontmatter[key] = cleanValue;
}
}
// Replace title with noteTitle if provided
if (this.noteTitle) {
frontmatter.title = this.noteTitle;
}
result.metadata.frontmatter = frontmatter;
if (this.preserveFrontmatter) {
// Reconstruct frontmatter with modified title
if (this.noteTitle) {
const yaml = require('js-yaml');
const newFrontmatter = yaml.dump(frontmatter);
let processedContent = content.replace(this.FRONTMATTER_PATTERN, `---\n${newFrontmatter}---\n`);
// Add printed frontmatter if requested
if (this.printFrontmatter) {
const frontmatterDisplay = this.formatFrontmatterForDisplay(frontmatter);
processedContent = processedContent.replace(
this.FRONTMATTER_PATTERN,
`---\n${newFrontmatter}---\n\n${frontmatterDisplay}\n\n`
);
}
return processedContent;
} else {
return content;
}
} else {
// Add title as frontmatter for Pandoc even when not preserving original
if (this.noteTitle) {
const yaml = require('js-yaml');
const titleFrontmatter = yaml.dump({ title: this.noteTitle });
let processedContent = content.replace(this.FRONTMATTER_PATTERN, `---\n${titleFrontmatter}---\n`);
// Add printed frontmatter if requested
if (this.printFrontmatter) {
const frontmatterDisplay = this.formatFrontmatterForDisplay(frontmatter);
processedContent = processedContent.replace(
this.FRONTMATTER_PATTERN,
`---\n${titleFrontmatter}---\n\n${frontmatterDisplay}\n\n`
);
}
return processedContent;
} else {
return content.replace(this.FRONTMATTER_PATTERN, '');
}
}
} catch (fallbackError: unknown) {
const fallbackErrorMessage = fallbackError instanceof Error ? fallbackError.message : String(fallbackError);
result.warnings.push(`Fallback frontmatter parsing also failed: ${fallbackErrorMessage}`);
}
} else {
// No frontmatter pattern found, but gray-matter failed - treat as file without frontmatter
if (this.noteTitle) {
const yaml = require('js-yaml');
const titleFrontmatter = yaml.dump({ title: this.noteTitle });
result.metadata.title = this.noteTitle;
result.metadata.frontmatter = { title: this.noteTitle };
return `---\n${titleFrontmatter}---\n${content}`;
}
}
return content;
} }
}
/** /**
* Format frontmatter as a readable display block * Format frontmatter as a readable display block
*/ */
private formatFrontmatterForDisplay(frontmatter: Record<string, any>): string { private formatFrontmatterForDisplay(frontmatter: Record<string, unknown>): string {
if (!frontmatter || Object.keys(frontmatter).length === 0) { if (!frontmatter || Object.keys(frontmatter).length === 0) {
return ''; return '';
} }
@@ -0,0 +1,77 @@
/**
* Processes horizontal rules to avoid conflicts with YAML frontmatter delimiters
*
* Transforms markdown horizontal rules that could be mistaken for YAML delimiters
* into alternative formats that Pandoc will still recognize as horizontal rules
* but won't interpret as YAML frontmatter boundaries.
*
* Preserves YAML frontmatter sections by detecting and skipping them.
*/
export class HorizontalRuleProcessor {
private readonly FRONTMATTER_PATTERN = /^---\s*\n([\s\S]*?)\n---\s*\n/;
constructor() {
// No initialization needed
}
/**
* Process horizontal rules to avoid YAML conflicts
*
* Transforms:
* - `---` (3 dashes) -> `***` (3 asterisks)
* - `----` (4+ dashes) -> `****` (4+ asterisks)
*
* Both formats are valid markdown horizontal rules but `***` won't be
* mistaken for YAML delimiters by Pandoc.
*
* Skips YAML frontmatter sections to preserve them.
*/
process(content: string): string {
// Check if content has frontmatter at the beginning
const frontmatterMatch = content.match(this.FRONTMATTER_PATTERN);
if (frontmatterMatch) {
// Content has frontmatter - separate it from the main content
const frontmatter = frontmatterMatch[0];
const mainContent = content.slice(frontmatter.length);
// Process only the main content (after frontmatter)
const processedMainContent = this.processContentLines(mainContent);
// Recombine frontmatter with processed main content
return frontmatter + processedMainContent;
} else {
// No frontmatter - process the entire content
return this.processContentLines(content);
}
}
/**
* Process lines for horizontal rule transformation
*/
private processContentLines(content: string): string {
// Split content into lines for processing
const lines = content.split('\n');
const processedLines: string[] = [];
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
// Check if line is a horizontal rule made of dashes
// Must be at least 3 dashes, optionally with spaces
const dashRuleMatch = line.match(/^(\s*)(---+)(\s*)$/);
if (dashRuleMatch) {
// Transform dash horizontal rule to asterisk horizontal rule
const [, leadingSpaces, dashes, trailingSpaces] = dashRuleMatch;
const asterisks = '*'.repeat(dashes.length);
processedLines.push(`${leadingSpaces}${asterisks}${trailingSpaces}`);
} else {
// Keep line unchanged
processedLines.push(line);
}
}
return processedLines.join('\n');
}
}
@@ -23,7 +23,7 @@ export interface PreprocessingResult {
/** Extracted metadata including tags and frontmatter */ /** Extracted metadata including tags and frontmatter */
metadata: { metadata: {
tags: string[]; tags: string[];
frontmatter?: Record<string, any>; frontmatter?: Record<string, unknown>;
title?: string; title?: string;
pdfEmbeds?: Array<{ pdfEmbeds?: Array<{
originalPath: string; originalPath: string;
+1 -1
View File
@@ -52,7 +52,7 @@ export class ModalSettingsHelper {
/** /**
* Build template variables object from plugin settings * Build template variables object from plugin settings
*/ */
private static buildTemplateVariables(settings: obsidianTypstPDFExportSettings): Record<string, any> { private static buildTemplateVariables(settings: obsidianTypstPDFExportSettings): Record<string, string | number | boolean | undefined> {
const baseVariables = { const baseVariables = {
pageSize: settings.pageSetup.size, pageSize: settings.pageSetup.size,
orientation: settings.pageSetup.orientation, orientation: settings.pageSetup.orientation,
+1 -1
View File
@@ -132,7 +132,7 @@ export class ExportOrchestrator {
* Export a file with specific configuration * Export a file with specific configuration
*/ */
async exportFileWithConfig(file: TFile, config: ExportConfig): Promise<void> { async exportFileWithConfig(file: TFile, config: ExportConfig): Promise<void> {
const vaultPath = (this.plugin.app.vault.adapter as any).basePath; const vaultPath = (this.plugin.app.vault.adapter as unknown as { basePath: string }).basePath;
const pluginDir = path.join(vaultPath, this.plugin.manifest.dir!); const pluginDir = path.join(vaultPath, this.plugin.manifest.dir!);
// Create controller for this export (allows cancellation) // Create controller for this export (allows cancellation)
+1 -1
View File
@@ -57,7 +57,7 @@ export class PathResolver {
throw new Error(`Invalid output folder path: ${outputFolder}. Path contains invalid characters or traversal attempts.`); throw new Error(`Invalid output folder path: ${outputFolder}. Path contains invalid characters or traversal attempts.`);
} }
const vaultPath = (this.plugin.app.vault.adapter as any).basePath; const vaultPath = (this.plugin.app.vault.adapter as unknown as { basePath: string }).basePath;
const outputDir = path.join(vaultPath, outputFolder); const outputDir = path.join(vaultPath, outputFolder);
// Create output directory if it doesn't exist // Create output directory if it doesn't exist
+3 -3
View File
@@ -22,7 +22,7 @@ export class PluginLifecycle {
await this.plugin.loadSettings(); await this.plugin.loadSettings();
// Initialize embedded template manager // Initialize embedded template manager
const vaultPath = (this.plugin.app.vault.adapter as any).basePath; const vaultPath = (this.plugin.app.vault.adapter as unknown as { basePath: string }).basePath;
const pluginDir = path.join(vaultPath, this.plugin.manifest.dir!); const pluginDir = path.join(vaultPath, this.plugin.manifest.dir!);
this.plugin.embeddedTemplateManager = new EmbeddedTemplateManager(pluginDir); this.plugin.embeddedTemplateManager = new EmbeddedTemplateManager(pluginDir);
@@ -66,7 +66,7 @@ export class PluginLifecycle {
// Clean up temp directories on plugin unload // Clean up temp directories on plugin unload
try { try {
const vaultPath = (this.plugin.app.vault.adapter as any).basePath; const vaultPath = (this.plugin.app.vault.adapter as unknown as { basePath: string }).basePath;
const cleanupManager = TempDirectoryManager.create(vaultPath, this.plugin.app.vault.configDir); const cleanupManager = TempDirectoryManager.create(vaultPath, this.plugin.app.vault.configDir);
cleanupManager.cleanupAllTempDirs(); cleanupManager.cleanupAllTempDirs();
} catch (error) { } catch (error) {
@@ -79,7 +79,7 @@ export class PluginLifecycle {
*/ */
private cleanupStartupTempDirectories(): void { private cleanupStartupTempDirectories(): void {
try { try {
const vaultPath = (this.plugin.app.vault.adapter as any).basePath; const vaultPath = (this.plugin.app.vault.adapter as unknown as { basePath: string }).basePath;
const cleanupManager = TempDirectoryManager.create(vaultPath, this.plugin.app.vault.configDir); const cleanupManager = TempDirectoryManager.create(vaultPath, this.plugin.app.vault.configDir);
const _result = cleanupManager.cleanupAllTempDirs(); const _result = cleanupManager.cleanupAllTempDirs();
+1 -1
View File
@@ -15,7 +15,7 @@ export class TemplateManager {
this.plugin = plugin; this.plugin = plugin;
// Templates are stored in the plugin directory // Templates are stored in the plugin directory
this.templatesPath = path.join( this.templatesPath = path.join(
(this.plugin.app.vault.adapter as any).basePath, (this.plugin.app.vault.adapter as unknown as { basePath: string }).basePath,
this.plugin.manifest.dir!, this.plugin.manifest.dir!,
'templates' 'templates'
); );
+3 -3
View File
@@ -13,7 +13,7 @@ export interface ExportConfig {
/** Override output folder */ /** Override output folder */
outputFolder?: string; outputFolder?: string;
/** Template variables for this export */ /** Template variables for this export */
templateVariables?: Record<string, any>; templateVariables?: Record<string, string | number | boolean | undefined>;
/** Open PDF after export */ /** Open PDF after export */
openAfterExport?: boolean; openAfterExport?: boolean;
/** Preserve folder structure when exporting */ /** Preserve folder structure when exporting */
@@ -59,9 +59,9 @@ export interface ValidationResult {
export interface ModalState { export interface ModalState {
settings: ExportConfigModalSettings; settings: ExportConfigModalSettings;
templateVariables: Record<string, any>; templateVariables: Record<string, string | number | boolean | undefined>;
updateSettings(updates: Partial<ExportConfigModalSettings>): void; updateSettings(updates: Partial<ExportConfigModalSettings>): void;
updateTemplateVariables(updates: Record<string, any>): void; updateTemplateVariables(updates: Record<string, string | number | boolean | undefined>): void;
buildExportConfig(): ExportConfig; buildExportConfig(): ExportConfig;
notifyChange(): void; notifyChange(): void;
setProgress(percent: number, operation: string): void; setProgress(percent: number, operation: string): void;
+3 -3
View File
@@ -33,7 +33,7 @@ export class PageSetupSection implements ModalSection {
}); });
dropdown dropdown
.setValue(state.templateVariables.pageSize || 'a4') .setValue(String(state.templateVariables.pageSize || 'a4'))
.onChange(value => { .onChange(value => {
state.updateTemplateVariables({ pageSize: value }); state.updateTemplateVariables({ pageSize: value });
}); });
@@ -50,7 +50,7 @@ export class PageSetupSection implements ModalSection {
dropdown dropdown
.addOption('portrait', 'Portrait') .addOption('portrait', 'Portrait')
.addOption('landscape', 'Landscape') .addOption('landscape', 'Landscape')
.setValue(state.templateVariables.orientation || 'portrait') .setValue(String(state.templateVariables.orientation || 'portrait'))
.onChange(value => { .onChange(value => {
const isLandscape = value === 'landscape'; const isLandscape = value === 'landscape';
state.updateTemplateVariables({ state.updateTemplateVariables({
@@ -90,7 +90,7 @@ export class PageSetupSection implements ModalSection {
.addText(text => { .addText(text => {
const input = text const input = text
.setPlaceholder(marginDefaults[side as keyof typeof marginDefaults]) .setPlaceholder(marginDefaults[side as keyof typeof marginDefaults])
.setValue(state.templateVariables[`margin${side.charAt(0).toUpperCase() + side.slice(1)}`] || marginDefaults[side as keyof typeof marginDefaults]) .setValue(String(state.templateVariables[`margin${side.charAt(0).toUpperCase() + side.slice(1)}`] || marginDefaults[side as keyof typeof marginDefaults]))
.onChange(value => { .onChange(value => {
const marginKey = `margin${side.charAt(0).toUpperCase() + side.slice(1)}`; const marginKey = `margin${side.charAt(0).toUpperCase() + side.slice(1)}`;
state.updateTemplateVariables({ [marginKey]: value }); state.updateTemplateVariables({ [marginKey]: value });
+6 -6
View File
@@ -31,7 +31,7 @@ export class TypographySection implements ModalSection {
.setName('Body font') .setName('Body font')
.setDesc('Primary font for document text') .setDesc('Primary font for document text')
.addDropdown(dropdown => { .addDropdown(dropdown => {
const currentFont = state.templateVariables.bodyFont || 'Times New Roman'; const currentFont = String(state.templateVariables.bodyFont || 'Times New Roman');
// Add all available fonts // Add all available fonts
availableFonts.forEach(font => { availableFonts.forEach(font => {
@@ -56,7 +56,7 @@ export class TypographySection implements ModalSection {
.setName('Heading font') .setName('Heading font')
.setDesc('Font for headings and titles') .setDesc('Font for headings and titles')
.addDropdown(dropdown => { .addDropdown(dropdown => {
const currentFont = state.templateVariables.headingFont || 'Times New Roman'; const currentFont = String(state.templateVariables.headingFont || 'Times New Roman');
// Add all available fonts // Add all available fonts
availableFonts.forEach(font => { availableFonts.forEach(font => {
@@ -81,7 +81,7 @@ export class TypographySection implements ModalSection {
.setName('Monospace font') .setName('Monospace font')
.setDesc('Font for code blocks and inline code') .setDesc('Font for code blocks and inline code')
.addDropdown(dropdown => { .addDropdown(dropdown => {
const currentFont = state.templateVariables.monospaceFont || 'Courier New'; const currentFont = String(state.templateVariables.monospaceFont || 'Courier New');
// Add all available fonts // Add all available fonts
availableFonts.forEach(font => { availableFonts.forEach(font => {
@@ -111,7 +111,7 @@ export class TypographySection implements ModalSection {
.setDesc('Base font size for document text (in points)') .setDesc('Base font size for document text (in points)')
.addSlider(slider => slider .addSlider(slider => slider
.setLimits(8, 16, 0.5) .setLimits(8, 16, 0.5)
.setValue(state.templateVariables.bodyFontSize || 11) .setValue(Number(state.templateVariables.bodyFontSize || 11))
.setDynamicTooltip() .setDynamicTooltip()
.onChange(value => { .onChange(value => {
state.updateTemplateVariables({ bodyFontSize: value }); state.updateTemplateVariables({ bodyFontSize: value });
@@ -179,7 +179,7 @@ export class TypographySection implements ModalSection {
: state.templateVariables.headingFont; : state.templateVariables.headingFont;
dropdown dropdown
.setValue(currentValue || 'Concourse OT') .setValue(String(currentValue || 'Concourse OT'))
.onChange((value: string) => { .onChange((value: string) => {
if (fontType === 'body') { if (fontType === 'body') {
state.updateTemplateVariables({ bodyFont: value }); state.updateTemplateVariables({ bodyFont: value });
@@ -199,7 +199,7 @@ export class TypographySection implements ModalSection {
.addOption('DejaVu Sans Mono', 'DejaVu Sans Mono') .addOption('DejaVu Sans Mono', 'DejaVu Sans Mono')
.addOption('Liberation Mono', 'Liberation Mono') .addOption('Liberation Mono', 'Liberation Mono')
.addOption('Ubuntu Mono', 'Ubuntu Mono') .addOption('Ubuntu Mono', 'Ubuntu Mono')
.setValue(state.templateVariables.monospaceFont || 'Source Code Pro') .setValue(String(state.templateVariables.monospaceFont || 'Source Code Pro'))
.onChange((value: string) => { .onChange((value: string) => {
state.updateTemplateVariables({ monospaceFont: value }); state.updateTemplateVariables({ monospaceFont: value });
}); });
+3 -3
View File
@@ -8,7 +8,7 @@ import { ExportFormat, obsidianTypstPDFExportSettings } from '../../../core/sett
export class ModalState implements IModalState { export class ModalState implements IModalState {
settings: ExportConfigModalSettings; settings: ExportConfigModalSettings;
templateVariables: Record<string, any>; templateVariables: Record<string, string | number | boolean | undefined>;
private changeListeners: Set<() => void> = new Set(); private changeListeners: Set<() => void> = new Set();
private static readonly STORAGE_KEY = 'typst-export-modal-state'; private static readonly STORAGE_KEY = 'typst-export-modal-state';
@@ -64,7 +64,7 @@ export class ModalState implements IModalState {
/** /**
* Update template variables * Update template variables
*/ */
updateTemplateVariables(updates: Record<string, any>): void { updateTemplateVariables(updates: Record<string, string | number | boolean | undefined>): void {
this.templateVariables = { this.templateVariables = {
...this.templateVariables, ...this.templateVariables,
...updates ...updates
@@ -198,7 +198,7 @@ export class ModalState implements IModalState {
/** /**
* Load state from localStorage * Load state from localStorage
*/ */
private loadFromStorage(): { settings: Partial<ExportConfigModalSettings>, templateVariables: Record<string, any> } | null { private loadFromStorage(): { settings: Partial<ExportConfigModalSettings>, templateVariables: Record<string, string | number | boolean> } | null {
try { try {
const saved = localStorage.getItem(ModalState.STORAGE_KEY); const saved = localStorage.getItem(ModalState.STORAGE_KEY);
if (saved) { if (saved) {
+3
View File
@@ -1,3 +1,6 @@
// Horizontal rule definition for Pandoc compatibility
#let horizontalrule = line(start: (25%,0%), end: (75%,0%))
// Email block styling function // Email block styling function
#let email-block(from: none, to: none, subject: none, date: none, body) = { #let email-block(from: none, to: none, subject: none, date: none, body) = {
block( block(
+3
View File
@@ -1,3 +1,6 @@
// Horizontal rule definition for Pandoc compatibility
#let horizontalrule = pad(y: 11pt, (line(stroke: 2pt + gray, length: 75%)))
// Email block styling function // Email block styling function
#let email-block(from: none, to: none, subject: none, date: none, body) = { #let email-block(from: none, to: none, subject: none, date: none, body) = {
block( block(
+3
View File
@@ -1,3 +1,6 @@
// Horizontal rule definition for Pandoc compatibility
#let horizontalrule = line(start: (25%,0%), end: (75%,0%))
// Email block styling function - compact for single page // Email block styling function - compact for single page
#let email-block(from: none, to: none, subject: none, date: none, body) = { #let email-block(from: none, to: none, subject: none, date: none, body) = {
block( block(
+3
View File
@@ -1,3 +1,6 @@
// Horizontal rule definition for Pandoc compatibility
#let horizontalrule = line(start: (25%,0%), end: (75%,0%))
// Email block styling function // Email block styling function
#let email-block(from: none, to: none, subject: none, date: none, body) = { #let email-block(from: none, to: none, subject: none, date: none, body) = {
block( block(
+1 -1
View File
@@ -1,7 +1,7 @@
// Universal Pandoc wrapper for all Typst templates // Universal Pandoc wrapper for all Typst templates
// This wrapper handles Pandoc's variable substitution and passes them to the actual Typst template // This wrapper handles Pandoc's variable substitution and passes them to the actual Typst template
#import "$template_path$": conf, email-block #import "$template_path$": conf, email-block, horizontalrule
#show: doc => conf( #show: doc => conf(
$if(title)$title: [$title$],$else$title: none,$endif$ $if(title)$title: [$title$],$else$title: none,$endif$
+2 -1
View File
@@ -2,5 +2,6 @@
"1.0.0": "1.9.12", "1.0.0": "1.9.12",
"1.0.1": "1.9.12", "1.0.1": "1.9.12",
"1.1.0": "1.9.12", "1.1.0": "1.9.12",
"1.2.0": "1.9.12" "1.2.0": "1.9.12",
"1.2.1": "1.9.12"
} }