feat: deliver P2 v0.2.0 with unified editor, search, and snapshots
Implement schema v2 migration, outline/setting/inspiration CRUD, unified TipTap editing, reference panel with mentions, FTS global search, chapter version history, writing landmarks, word frequency analysis, light theme contrast fixes, and full unit/E2E test coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { Mark, mergeAttributes } from '@tiptap/core'
|
||||
|
||||
export const LandmarkMark = Mark.create({
|
||||
name: 'landmark',
|
||||
inclusive: true,
|
||||
addAttributes() {
|
||||
return {
|
||||
label: { default: '' },
|
||||
landmarkType: { default: 'todo' }
|
||||
}
|
||||
},
|
||||
parseHTML() {
|
||||
return [{ tag: 'span[data-landmark]' }]
|
||||
},
|
||||
renderHTML({ HTMLAttributes }) {
|
||||
const label = HTMLAttributes.label ?? ''
|
||||
return [
|
||||
'span',
|
||||
mergeAttributes(HTMLAttributes, {
|
||||
'data-landmark': 'true',
|
||||
class: 'landmark-mark',
|
||||
'data-testid': 'landmark-mark'
|
||||
}),
|
||||
`[TODO: ${label}]`
|
||||
]
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user