Render structured list and table entries in stat block traits
Stat block traits containing 5etools list (e.g. Confusing Burble d4 effects) or table entries were silently dropped. The adapter now produces structured TraitSegment[] instead of flat text, preserving lists and tables as first-class data. The stat block component renders labeled list items inline (bold label + flowing text) matching the 5etools layout. Also fixes support for the singular "entry" field on list items and bumps the bestiary cache version to force re-normalize. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import { type IDBPDatabase, openDB } from "idb";
|
||||
|
||||
const DB_NAME = "initiative-bestiary";
|
||||
const STORE_NAME = "sources";
|
||||
const DB_VERSION = 2;
|
||||
const DB_VERSION = 3;
|
||||
|
||||
interface CachedSourceInfo {
|
||||
readonly sourceCode: string;
|
||||
@@ -38,8 +38,11 @@ async function getDb(): Promise<IDBPDatabase | null> {
|
||||
keyPath: "sourceCode",
|
||||
});
|
||||
}
|
||||
if (oldVersion < 2 && database.objectStoreNames.contains(STORE_NAME)) {
|
||||
// Clear cached creatures to pick up improved tag processing
|
||||
if (
|
||||
oldVersion < DB_VERSION &&
|
||||
database.objectStoreNames.contains(STORE_NAME)
|
||||
) {
|
||||
// Clear cached creatures so they get re-normalized with latest rendering
|
||||
void transaction.objectStore(STORE_NAME).clear();
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user