4aebbf679f
* fix: footnote now should be hidden in srcdoc iframes * fix: eliminate white flash on startup when using dark mode * feat: rescale UI size with pixel density
15 lines
384 B
TypeScript
15 lines
384 B
TypeScript
import type { Transformer } from './types';
|
|
|
|
export const footnoteTransformer: Transformer = {
|
|
name: 'footnote',
|
|
|
|
transform: async (ctx) => {
|
|
let result = ctx.content;
|
|
result = result.replace(
|
|
/<aside\s+epub:type\s*=\s*["'](footnote|endnote|note|rearnote)["']([^>]*)>/gi,
|
|
'<aside class="epubtype-footnote" epub:type="$1"$2>',
|
|
);
|
|
return result;
|
|
},
|
|
};
|