feat: add tests for normalizeName and RecipesService methods, including unit conversion and alias normalization
This commit is contained in:
@@ -22,6 +22,13 @@ function SimpleMarkdownPreview({ text }: { text: string }) {
|
||||
if (line.startsWith('# ')) return <h3 key={i} style={{ margin: '0.5rem 0 0.25rem', fontSize: '1.3em', fontWeight: 700 }}>{line.slice(2)}</h3>;
|
||||
if (line.startsWith('## ')) return <h4 key={i} style={{ margin: '0.5rem 0 0.25rem', fontSize: '1.1em', fontWeight: 700 }}>{line.slice(3)}</h4>;
|
||||
if (line.startsWith('- ') || line.startsWith('* ')) return <div key={i} style={{ marginLeft: '1.5rem' }}>• {line.slice(2)}</div>;
|
||||
const numberedMatch = line.match(/^(\d+)\.\s+(.*)/);
|
||||
if (numberedMatch) return (
|
||||
<div key={i} style={{ display: 'flex', gap: '0.6rem', marginBottom: '0.35rem' }}>
|
||||
<span style={{ fontWeight: 700, minWidth: '1.5rem', textAlign: 'right', flexShrink: 0 }}>{numberedMatch[1]}.</span>
|
||||
<span>{numberedMatch[2]}</span>
|
||||
</div>
|
||||
);
|
||||
if (line.trim() === '') return <div key={i} style={{ height: '0.5rem' }} />;
|
||||
return <div key={i}>{line}</div>;
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user