fix: improve markdown detection and fix line spacing in embedded notes
Count total occurrences of medium signals in containsMarkdown instead of only distinct types, so repeated patterns like multiple list items correctly trigger markdown rendering. Add whitespace-normal to MarkdownContent to prevent inherited whitespace-pre-wrap from parent note content causing inconsistent line spacing in embedded notes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c7eef9fa48
commit
e80474099e
2 changed files with 5 additions and 5 deletions
|
|
@ -122,7 +122,7 @@ export default function MarkdownContent({
|
|||
)
|
||||
|
||||
return (
|
||||
<div className="space-y-3">
|
||||
<div className="space-y-3 whitespace-normal">
|
||||
<Markdown
|
||||
remarkPlugins={[remarkGfm, remarkNostr, remarkInlineContent]}
|
||||
urlTransform={(url) => {
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ export function containsMarkdown(content: string): boolean {
|
|||
|
||||
let matchCount = 0
|
||||
for (const pattern of mediumPatterns) {
|
||||
if (pattern.test(cleaned)) {
|
||||
matchCount++
|
||||
if (matchCount >= 2) return true
|
||||
}
|
||||
const globalPattern = new RegExp(pattern.source, pattern.flags.includes('m') ? 'gm' : 'g')
|
||||
const occurrences = (cleaned.match(globalPattern) || []).length
|
||||
matchCount += occurrences
|
||||
if (matchCount >= 2) return true
|
||||
}
|
||||
|
||||
return false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue