tenta fix pdfservice.js
This commit is contained in:
1 parent
e21dea582c
commit
a208caec55
1 file changed
+6
-7
@@ -423,7 +423,7 @@ export class PdfService {
|
|||||||
if (remaining.startsWith('<b>') || remaining.startsWith('<strong>')) {
|
if (remaining.startsWith('<b>') || remaining.startsWith('<strong>')) {
|
||||||
// Adiciona o texto acumulado antes da tag
|
// Adiciona o texto acumulado antes da tag
|
||||||
if (currentChunk) {
|
if (currentChunk) {
|
||||||
formattedChunks.push({ text: currentChunk, isItalic, isBold });
|
formattedChunks.push({ text: currentChunk, isItalic: inItalic, isBold: inBold });
|
||||||
currentChunk = '';
|
currentChunk = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -433,7 +433,7 @@ export class PdfService {
|
|||||||
else if (remaining.startsWith('</b>') || remaining.startsWith('</strong>')) {
|
else if (remaining.startsWith('</b>') || remaining.startsWith('</strong>')) {
|
||||||
// Adiciona o texto acumulado em negrito
|
// Adiciona o texto acumulado em negrito
|
||||||
if (currentChunk) {
|
if (currentChunk) {
|
||||||
formattedChunks.push({ text: currentChunk, isItalic, isBold: true });
|
formattedChunks.push({ text: currentChunk, isItalic: inItalic, isBold: true });
|
||||||
currentChunk = '';
|
currentChunk = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -443,7 +443,7 @@ export class PdfService {
|
|||||||
else if (remaining.startsWith('<i>') || remaining.startsWith('<em>')) {
|
else if (remaining.startsWith('<i>') || remaining.startsWith('<em>')) {
|
||||||
// Adiciona o texto acumulado antes da tag
|
// Adiciona o texto acumulado antes da tag
|
||||||
if (currentChunk) {
|
if (currentChunk) {
|
||||||
formattedChunks.push({ text: currentChunk, isItalic, isBold });
|
formattedChunks.push({ text: currentChunk, isItalic: inItalic, isBold: inBold });
|
||||||
currentChunk = '';
|
currentChunk = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -453,7 +453,7 @@ export class PdfService {
|
|||||||
else if (remaining.startsWith('</i>') || remaining.startsWith('</em>')) {
|
else if (remaining.startsWith('</i>') || remaining.startsWith('</em>')) {
|
||||||
// Adiciona o texto acumulado em itálico
|
// Adiciona o texto acumulado em itálico
|
||||||
if (currentChunk) {
|
if (currentChunk) {
|
||||||
formattedChunks.push({ text: currentChunk, isItalic: true, isBold });
|
formattedChunks.push({ text: currentChunk, isItalic: true, isBold: inBold });
|
||||||
currentChunk = '';
|
currentChunk = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -463,7 +463,7 @@ export class PdfService {
|
|||||||
else if (remaining.startsWith('<br>') || remaining.startsWith('<br/>') || remaining.startsWith('<br />')) {
|
else if (remaining.startsWith('<br>') || remaining.startsWith('<br/>') || remaining.startsWith('<br />')) {
|
||||||
// Adiciona o texto acumulado e então adiciona uma quebra de linha
|
// Adiciona o texto acumulado e então adiciona uma quebra de linha
|
||||||
if (currentChunk) {
|
if (currentChunk) {
|
||||||
formattedChunks.push({ text: currentChunk, isItalic, isBold });
|
formattedChunks.push({ text: currentChunk, isItalic: inItalic, isBold: inBold });
|
||||||
currentChunk = '';
|
currentChunk = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -479,10 +479,9 @@ export class PdfService {
|
|||||||
|
|
||||||
// Adiciona qualquer texto restante
|
// Adiciona qualquer texto restante
|
||||||
if (currentChunk) {
|
if (currentChunk) {
|
||||||
formattedChunks.push({ text: currentChunk, isItalic, isBold });
|
formattedChunks.push({ text: currentChunk, isItalic: inItalic, isBold: inBold });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Agora temos o texto dividido em chunks com formatação
|
|
||||||
let lines: { chunks: { text: string, isItalic: boolean, isBold: boolean }[], width: number }[] = [{ chunks: [], width: 0 }];
|
let lines: { chunks: { text: string, isItalic: boolean, isBold: boolean }[], width: number }[] = [{ chunks: [], width: 0 }];
|
||||||
let currentLineIndex = 0;
|
let currentLineIndex = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user