Temporarily disable PDF parsing - use placeholder content until pdf-parse issue is resolved

This commit is contained in:
Torsten Schulz (local)
2025-10-22 13:06:38 +02:00
parent 12057ea252
commit 57280be256
5 changed files with 598 additions and 598 deletions

View File

@@ -1,5 +1,5 @@
{
"date": "2025-10-22T11:04:02.616Z",
"date": "2025-10-22T11:05:21.224Z",
"preset": "node-server",
"framework": {
"name": "nuxt",

View File

@@ -1 +1 @@
{"id":"62bd95ce-2f75-4dc9-b46e-5186240eb9aa","timestamp":1761131034878}
{"id":"0dba23de-7847-464a-b39b-84f518a19d3a","timestamp":1761131113397}

View File

@@ -2,12 +2,12 @@ const interopDefault = r => r.default || r || [];
const styles = {
"node_modules/nuxt/dist/app/components/error-404.vue": () => import('./error-404-styles.BsF5Lbhq.mjs').then(interopDefault),
"node_modules/nuxt/dist/app/components/error-500.vue": () => import('./error-500-styles.Dccc6iq5.mjs').then(interopDefault),
"node_modules/nuxt/dist/app/components/error-404.vue?vue&type=style&index=0&scoped=b728498f&lang.css": () => import('./error-404-styles.BsF5Lbhq.mjs').then(interopDefault),
"node_modules/nuxt/dist/app/components/error-500.vue?vue&type=style&index=0&scoped=70d84538&lang.css": () => import('./error-500-styles.Dccc6iq5.mjs').then(interopDefault),
"components/Hero.vue": () => import('./Hero-styles.03iOjY05.mjs').then(interopDefault),
"components/PublicNews.vue": () => import('./PublicNews-styles.nhqk16g5.mjs').then(interopDefault),
"components/Hero.vue?vue&type=style&index=0&scoped=779d39d7&lang.css": () => import('./Hero-styles.03iOjY05.mjs').then(interopDefault),
"components/PublicNews.vue?vue&type=style&index=0&scoped=f894f108&lang.css": () => import('./PublicNews-styles.nhqk16g5.mjs').then(interopDefault)
"components/PublicNews.vue?vue&type=style&index=0&scoped=f894f108&lang.css": () => import('./PublicNews-styles.nhqk16g5.mjs').then(interopDefault),
"node_modules/nuxt/dist/app/components/error-404.vue?vue&type=style&index=0&scoped=b728498f&lang.css": () => import('./error-404-styles.BsF5Lbhq.mjs').then(interopDefault),
"node_modules/nuxt/dist/app/components/error-500.vue?vue&type=style&index=0&scoped=70d84538&lang.css": () => import('./error-500-styles.Dccc6iq5.mjs').then(interopDefault)
};
export { styles as default };

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,6 @@
import multer from 'multer'
import fs from 'fs/promises'
import path from 'path'
import { createRequire } from 'module'
const require = createRequire(import.meta.url)
const pdfParse = require('pdf-parse')
// Multer-Konfiguration für PDF-Uploads
const storage = multer.diskStorage({
@@ -55,12 +51,15 @@ export default defineEventHandler(async (event) => {
})
}
// PDF-Text extrahieren
const pdfBuffer = await fs.readFile(file.path)
const pdfData = await pdfParse.default(pdfBuffer)
// Text in HTML-Format konvertieren (einfache Formatierung)
const htmlContent = convertTextToHtml(pdfData.text)
// Für jetzt: Einfacher Platzhalter-Text statt PDF-Parsing
// TODO: PDF-Parsing später implementieren
const htmlContent = `
<h2>Satzung</h2>
<p>Die Satzung wurde erfolgreich hochgeladen.</p>
<p><strong>Datei:</strong> ${file.originalname}</p>
<p><strong>Größe:</strong> ${(file.size / 1024).toFixed(2)} KB</p>
<p><em>Hinweis: Der Text-Inhalt wird automatisch extrahiert, sobald das PDF-Parsing implementiert ist.</em></p>
`
// Config aktualisieren
const configPath = 'server/data/config.json'
@@ -88,16 +87,17 @@ export default defineEventHandler(async (event) => {
}
})
function convertTextToHtml(text) {
// Einfache Text-zu-HTML-Konvertierung
let html = text
.replace(/\n\n+/g, '</p><p>') // Absätze
.replace(/\n/g, '<br>') // Zeilenumbrüche
.replace(/^(.+)$/gm, '<p>$1</p>') // Alle Zeilen in Paragraphen
// Überschriften erkennen (einfache Heuristik)
html = html.replace(/<p>(§\s*\d+.*?)<\/p>/g, '<h3>$1</h3>')
html = html.replace(/<p>(\d+\.\s+.*?)<\/p>/g, '<h4>$1</h4>')
return `<h2>Satzung</h2>${html}`
}
// TODO: PDF-Parsing-Funktion später implementieren
// function convertTextToHtml(text) {
// // Einfache Text-zu-HTML-Konvertierung
// let html = text
// .replace(/\n\n+/g, '</p><p>') // Absätze
// .replace(/\n/g, '<br>') // Zeilenumbrüche
// .replace(/^(.+)$/gm, '<p>$1</p>') // Alle Zeilen in Paragraphen
//
// // Überschriften erkennen (einfache Heuristik)
// html = html.replace(/<p>(§\s*\d+.*?)<\/p>/g, '<h3>$1</h3>')
// html = html.replace(/<p>(\d+\.\s+.*?)<\/p>/g, '<h4>$1</h4>')
//
// return `<h2>Satzung</h2>${html}`
// }