Temporarily disable PDF parsing - use placeholder content until pdf-parse issue is resolved
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"date": "2025-10-22T11:04:02.616Z",
|
"date": "2025-10-22T11:05:21.224Z",
|
||||||
"preset": "node-server",
|
"preset": "node-server",
|
||||||
"framework": {
|
"framework": {
|
||||||
"name": "nuxt",
|
"name": "nuxt",
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"id":"62bd95ce-2f75-4dc9-b46e-5186240eb9aa","timestamp":1761131034878}
|
{"id":"0dba23de-7847-464a-b39b-84f518a19d3a","timestamp":1761131113397}
|
||||||
@@ -2,12 +2,12 @@ const interopDefault = r => r.default || r || [];
|
|||||||
const styles = {
|
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-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-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/Hero.vue": () => import('./Hero-styles.03iOjY05.mjs').then(interopDefault),
|
||||||
"components/PublicNews.vue": () => import('./PublicNews-styles.nhqk16g5.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/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 };
|
export { styles as default };
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,6 @@
|
|||||||
import multer from 'multer'
|
import multer from 'multer'
|
||||||
import fs from 'fs/promises'
|
import fs from 'fs/promises'
|
||||||
import path from 'path'
|
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
|
// Multer-Konfiguration für PDF-Uploads
|
||||||
const storage = multer.diskStorage({
|
const storage = multer.diskStorage({
|
||||||
@@ -55,12 +51,15 @@ export default defineEventHandler(async (event) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// PDF-Text extrahieren
|
// Für jetzt: Einfacher Platzhalter-Text statt PDF-Parsing
|
||||||
const pdfBuffer = await fs.readFile(file.path)
|
// TODO: PDF-Parsing später implementieren
|
||||||
const pdfData = await pdfParse.default(pdfBuffer)
|
const htmlContent = `
|
||||||
|
<h2>Satzung</h2>
|
||||||
// Text in HTML-Format konvertieren (einfache Formatierung)
|
<p>Die Satzung wurde erfolgreich hochgeladen.</p>
|
||||||
const htmlContent = convertTextToHtml(pdfData.text)
|
<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
|
// Config aktualisieren
|
||||||
const configPath = 'server/data/config.json'
|
const configPath = 'server/data/config.json'
|
||||||
@@ -88,16 +87,17 @@ export default defineEventHandler(async (event) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
function convertTextToHtml(text) {
|
// TODO: PDF-Parsing-Funktion später implementieren
|
||||||
// Einfache Text-zu-HTML-Konvertierung
|
// function convertTextToHtml(text) {
|
||||||
let html = text
|
// // Einfache Text-zu-HTML-Konvertierung
|
||||||
.replace(/\n\n+/g, '</p><p>') // Absätze
|
// let html = text
|
||||||
.replace(/\n/g, '<br>') // Zeilenumbrüche
|
// .replace(/\n\n+/g, '</p><p>') // Absätze
|
||||||
.replace(/^(.+)$/gm, '<p>$1</p>') // Alle Zeilen in Paragraphen
|
// .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>')
|
// // Überschriften erkennen (einfache Heuristik)
|
||||||
html = html.replace(/<p>(\d+\.\s+.*?)<\/p>/g, '<h4>$1</h4>')
|
// 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}`
|
//
|
||||||
}
|
// return `<h2>Satzung</h2>${html}`
|
||||||
|
// }
|
||||||
|
|||||||
Reference in New Issue
Block a user