Implement professional smart formatting with toggle logic and whitespace preservation

This commit is contained in:
2025-09-21 21:55:08 +02:00
parent d44bdd41b4
commit 0cfce1c95a
8 changed files with 1304 additions and 289 deletions

View File

@@ -29,12 +29,11 @@ export class ApiClient {
}
async createContent(content, type, htmlMarkup) {
async createContent(content, htmlMarkup) {
try {
const payload = {
html_markup: htmlMarkup, // Always send HTML markup - server extracts ID or generates new one
html_content: content,
type: type,
file_path: this.getCurrentFilePath() // Always include file path for consistent ID generation
};
@@ -49,7 +48,7 @@ export class ApiClient {
if (response.ok) {
const result = await response.json();
console.log(`✅ Content created: ${result.id} (${result.type})`);
console.log(`✅ Content created: ${result.id}`);
return result;
} else {
console.warn(`⚠️ Create failed (${response.status}): server will generate ID`);