improve and fix ci stuff. cleanup debug
This commit is contained in:
@@ -169,6 +169,8 @@ export function dungeonTemplate(data) {
|
||||
vertical-align: top;
|
||||
line-height: 1.3em;
|
||||
border-bottom: 1px solid #1a1a1a;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
table tr:last-child td {
|
||||
border-bottom: 1px solid #1a1a1a;
|
||||
@@ -181,12 +183,14 @@ export function dungeonTemplate(data) {
|
||||
}
|
||||
.encounters-table td:nth-child(2) {
|
||||
font-weight: bold;
|
||||
width: 30%;
|
||||
width: 25%;
|
||||
padding-right: 0.5em;
|
||||
border-right: 1px solid #1a1a1a;
|
||||
}
|
||||
.encounters-table td:nth-child(3) {
|
||||
width: auto;
|
||||
font-size: 0.75em;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
.map-page {
|
||||
display: flex;
|
||||
@@ -265,13 +269,35 @@ export function dungeonTemplate(data) {
|
||||
<h2>Encounters (d6)</h2>
|
||||
<table class="encounters-table">
|
||||
<tbody>
|
||||
${data.encounters.map((encounter, index) => `
|
||||
${data.encounters.map((encounter, index) => {
|
||||
// Truncate details to 2-3 sentences max to prevent overflow
|
||||
let details = encounter.details || '';
|
||||
// Remove location prefix from details if present (format: "Location Name: details")
|
||||
details = details.replace(/^[^:]+:\s*/, '');
|
||||
// Split into sentences and keep only first 3
|
||||
const sentences = details.match(/[^.!?]+[.!?]+/g) || [details];
|
||||
if (sentences.length > 3) {
|
||||
details = sentences.slice(0, 3).join(' ').trim();
|
||||
}
|
||||
// Also limit by character count as fallback (max ~250 chars)
|
||||
if (details.length > 250) {
|
||||
details = details.substring(0, 247).trim();
|
||||
// Try to end at a sentence boundary
|
||||
const lastPeriod = details.lastIndexOf('.');
|
||||
if (lastPeriod > 200) {
|
||||
details = details.substring(0, lastPeriod + 1);
|
||||
} else {
|
||||
details += '...';
|
||||
}
|
||||
}
|
||||
return `
|
||||
<tr>
|
||||
<td>${index + 1}</td>
|
||||
<td><strong>${encounter.name}</strong></td>
|
||||
<td>${encounter.details}</td>
|
||||
<td>${details}</td>
|
||||
</tr>
|
||||
`).join('')}
|
||||
`;
|
||||
}).join('')}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -304,11 +330,31 @@ export function dungeonTemplate(data) {
|
||||
${data.plotResolutions && data.plotResolutions.length > 0 ? `
|
||||
<div class="section-block">
|
||||
<h2>Plot Resolutions</h2>
|
||||
${data.plotResolutions.map(resolution => `
|
||||
${data.plotResolutions.map(resolution => {
|
||||
// Truncate to 1-2 sentences max to prevent overflow
|
||||
let text = resolution || '';
|
||||
// Split into sentences and keep only first 2
|
||||
const sentences = text.match(/[^.!?]+[.!?]+/g) || [text];
|
||||
if (sentences.length > 2) {
|
||||
text = sentences.slice(0, 2).join(' ').trim();
|
||||
}
|
||||
// Also limit by character count as fallback (max ~150 chars)
|
||||
if (text.length > 150) {
|
||||
text = text.substring(0, 147).trim();
|
||||
// Try to end at a sentence boundary
|
||||
const lastPeriod = text.lastIndexOf('.');
|
||||
if (lastPeriod > 100) {
|
||||
text = text.substring(0, lastPeriod + 1);
|
||||
} else {
|
||||
text += '...';
|
||||
}
|
||||
}
|
||||
return `
|
||||
<div class="plot-resolution">
|
||||
${resolution}
|
||||
${text}
|
||||
</div>
|
||||
`).join('')}
|
||||
`;
|
||||
}).join('')}
|
||||
</div>
|
||||
` : ''}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user