more html part 1
All checks were successful
ci / build (push) Successful in 1m6s

This commit is contained in:
Christopher Hase 2025-03-31 09:32:41 +02:00
parent 221572f5e4
commit 080d7e84a7
2 changed files with 11 additions and 33 deletions

View file

@ -197,6 +197,9 @@ function render(node: Node): string {
case "Root": case "Root":
return render(node.child!); return render(node.child!);
case "Hexagram": case "Hexagram":
//NEW
node.value = node.value?.replace("<h1>", "<div style=\"border: 1px dotted gray; border-radius: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; padding-bottom: 10px; width: auto; display: inline-block; color: gray; text-align: center; box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);\"><h1>");
node.value = node.value?.replace("</h1>", "</h1><div style=\"border: 1px solid gray; border-radius: 25px; padding-left: 30px; padding-right: 30px; padding-top: 20px; width: auto; display: inline-block; text-align: center; box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);\"><h2>"); node.value = node.value?.replace("</h1>", "</h1><div style=\"border: 1px solid gray; border-radius: 25px; padding-left: 30px; padding-right: 30px; padding-top: 20px; width: auto; display: inline-block; text-align: center; box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);\"><h2>");
node.value = node.value?.replace("<br>", " - "); node.value = node.value?.replace("<br>", " - ");
outputHTML = "<br><p>" + node.value + "</h2></div></p>"; outputHTML = "<br><p>" + node.value + "</h2></div></p>";
@ -204,10 +207,17 @@ function render(node: Node): string {
return outputHTML; return outputHTML;
//NEW
case "Images":
outputHTML = "<p>" + node.value + "</p></div>"; //EXTRA closing div
outputHTML = outputHTML + render(node.child!);
return outputHTML;
case "ChangingLines" : case "ChangingLines" :
const regex = new RegExp("~", "g"); const regex = new RegExp("~", "g");
node.value = node.value?.replace(regex, ""); node.value = node.value?.replace(regex, "");
outputHTML = "<p><div style=\"border: 1px dashed gray; border-radius: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; width: auto; display: inline-block; color: gray; text-align: center; box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);\">" + node.value + "</div></p>"; outputHTML = "<br><p><div style=\"border: 1px dashed gray; border-radius: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; width: auto; display: inline-block; color: gray; text-align: center; box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);\">" + node.value + "</div></p><br>";
outputHTML = outputHTML + render(node.child!); outputHTML = outputHTML + render(node.child!);
return outputHTML; return outputHTML;

View file

@ -1,32 +0,0 @@
//import * as nodemailer from "nodemailer";
//const nodemailer = require('lib/nodemailer');
//const nodemailer = require('node_modules/nodemailer/lib/nodemailer');
const nodemailer = require('nodemailer');
// Erstelle den Transporter
const transporter = nodemailer.createTransport({
//host: "localhost", // MailHog läuft standardmäßig auf localhost
host: "mailhog.mailhog.svc.cluster.local", //"10.96.177.226", // MailHog ClusterIP
port: 1025, // Standard-MailHog SMTP-Port
secure: false // MailHog benötigt keine Verschlüsselung
});
// E-Mail senden
async function sendEmail() {
try {
const info = await transporter.sendMail({
from: '"Test Sender" <test@example.com>',
to: "Christopher.Hase@telekom.com;test@mailhog.local",
subject: "Hallo von MailHog",
text: "Das ist eine Test-E-Mail mit MailHog und TypeScript.",
html: "<p>Das ist eine <b>Test-E-Mail</b> mit MailHog und TypeScript.</p>"
});
console.log("E-Mail gesendet: ", info.messageId);
} catch (error) {
console.error("Fehler beim Senden der E-Mail:", error);
}
}
sendEmail();