Repository navigation
v0.1.27
Reader highlights in five colours, anchors that find their words again after an outside edit, pictures that resolve against their document, a page frame that takes presses and drags for the editor, and a paste into source that lands in the source.
New
markdown::Editing::basenames the directory a relative image path is joined onto, andmarkdown::image_sourceresolves a URL the way the renderer does: anything with://and any absolute path as written, a relative path under the base. The editor takes one per document throughEditor::with_base,set_baseandbase. The stored URL is unchanged.Editor::presstakes a press from a host frame around the editor — padding, a floor under a short document — and places the caret at the nearest row, starts a drag, or dismisses a selection, as a press on the document would. A press the editor's own box took is marked withWindow::prevent_defaultand ignored.markdown::HighlightColornames a reader's highlight — yellow, green, blue, pink, purple — with a stablenameto store andfrom_nameto read it back.Annotation::Highlight(color)washes an anchor's range in it, so an editor anchor can be a highlight as well as a comment thread.markdown::set_highlight_paintinstalls what eachHighlightColorpaints, handed the theme so light and dark can differ. Without it,markdown::default_highlightpaints a translucent wash that keeps text at 7:1 or better.markdown::Quotefinds a range again in a document changed outside the editor.Quote::oftakes the text under a range and up to 32 characters either side;Quote::findanswers the saved range while it still covers that text, and otherwise the occurrence with the most context intact, nearest the old position on a tie.ToggleHighlight, oncmd-shift-hon macOS andctrl-shift-helsewhere, toggles the custom mark namededitor::HIGHLIGHT_MARK(highlight) and does nothing until the app registers a mark under that name.
Changed
markdown::Editinghas abasefield; a struct literal without..Default::default()has to name it.ImageStore::keeptakes the asking editor's base as a third argument,Option<&Path>. The store runs while that editor is being updated, and reading it there panics.- Editor anchors are no longer comment-only:
CommentIdisAnchorId,EditorEvent::CommentActivatedisEditorEvent::AnchorActivated, andEditor::comment_atisEditor::anchor_at. markdown::Annotationis#[non_exhaustive].
Fixed
- A file dragged over the editor and taken out or released elsewhere no longer leaves the drop line behind.
- A text selection, a lifted block and an image resize keep following the pointer once a drag leaves the editor's box.
- Paste in source mode, or inside a code block, inserts the clipboard text at the caret and leaves the caret after it, rather than splicing parsed blocks in beside the source. A URL, a picture or a copied file goes in as its text there.