Repository navigation
Inkkit 0.3.1
Inkkit 0.3.1
Authored reference text, a repaired selection and gap cursor, new host controls, and edits that keep more of the source an author wrote.
Added
FileReference.rawandWikiLinkReference.rawgive the Markdown of a file embed or wiki link as the document holds it, including its alias, escapes and a table cell's\|. Use it to match a reference to the text insnapshot(), and to tell[[Plan]]from[[Plan|Plan]].refreshReferences(targets?, expectedGeneration?)resolves wiki links and file embeds again, all of them or those whosetargetmatches. It works in a read-only editor and during composition, and a file card stays as it is until the new answer differs.appendImages(images, expectedGeneration?)adds images as the last blocks without moving focus, scrolling or changing the selection. It returnsfalsein source and TXT modes or without an image adapter, and a document that ends in an unclosed code fence refuses it withpreservation.ImageAdapter.contextMenu(reference, point, context)lets a host show its own menu, such as Save Image, on an image. Inkkit selects the image and suppresses the web view's menu only when the hook is set.EditorOptions.linkSchemeslists extra link schemes, such asthings, that render, open throughevents.openLink, passformat('link')and stay in copied HTML.javascript,data,vbscriptandfileare refused withinvalid-argument, and pasted HTML and print keep only the built-in schemes.- The shortcut names
indentandoutdent, bound by default toTabandShift-Tab, let a host choose other keys for list indentation. - A host slash command that throws or rejects reports the new
slash-command-failederror code, with the original error ascause. AnInkKitErrorthat the command throws is reported unchanged.
Fixed
- A screenshot that the clipboard holds as both PNG and TIFF is inserted once. Images in one paste or drop collapse into one when their bytes are identical, or when a PNG and a TIFF have the same pixel size and matching names. Different images still insert separately.
- Text typed at the end of an existing link no longer joins it. Typing
safter[docs](docs)saves[docs](docs)s, not[docss](docs), and a space typed there is saved outside the link. This holds for keys,insertTextand composed text, for inline links, reference links and angle autolinks. - A link started with
format('link', { destination })takes the text typed next until the first whitespace or until the caret moves. Text that replaces part or all of a link's label, by typing, plain-text paste or find and replace, stays in the link. Bare addresses keep growing as you type them. The Markdown support page has the rules under typing at a link's edges. - Typing in link text keeps bold, italic, strikethrough and highlight outside the link. Typing
Xin**[a b](u)**now saves**[a b](u)X**, not[**a bX**](u). - A new line or item in a quote, callout or list keeps the document's own quote markers and indentation, so a pasted line break no longer saves a lazy continuation line, and an item added to an indented list is no longer refused.
- Tab and Shift+Tab on a list item keep its source, including its emphasis delimiters. Lifting a paragraph out of a quote that opens a list item no longer writes a
<br />line, and Backspace after a typed code fence takes the fence back. - Typing
;after&,©or#saves the characters typed instead of being refused, and text typed inside an unknown reference such as&am;lands in the right place. - Enter beside an unsupported callout inside a quote or list item no longer refuses the edit, and a tight list beside such a callout keeps its authored lines.
- A fenced or indented code block in a document that uses lone CR line endings is saved with CR, not LF.
- A paragraph that holds only
%%c%%stays on one line unless it holds a line break. A comment written on three lines stays on three. - The selection is painted by one editor at a time. It no longer stays highlighted after focus moves to another editor or to text elsewhere on the page, and it no longer draws the full-width bars that WebKit added.
Appearance
- The gap cursor after a final table, image, callout or divider is a 2px caret, one line tall, in the accent color.
--inkkit-selection-backgroundcolors selected text while the editor has focus in an active window.--inkkit-inactive-selection-backgroundcolors it while the window is inactive, while focus is in a host field, or afterblur().- Wiki links share the link color and hover underline. A link that
WikiLinkAdapter.resolvereports as missing gets a dashed underline, which also shows in forced-colors mode, and thewikiMissinglabel as its accessible description.
Compatibility
This release has one source-breaking change and one new error code.
rawis required.FileReference.rawandWikiLinkReference.raware required properties. A host test double or fixture that builds either type does not compile until it suppliesraw. Code that only reads references is unaffected.- A new error code.
slash-command-failedjoins the closedEditorErrorCodelist. A host with an exhaustiveswitchover error codes needs a new branch. - Everything else is additive.
refreshReferences,appendImages,ImageAdapter.contextMenu,EditorOptions.linkSchemes, theindentandoutdentshortcut names, and the two selection tokens change nothing for a host that does not use them. The defaultTabandShift-Tabbehaviour in lists is the same as before. - Saved bytes differ in a few edits. The list, quote, link, character reference, lone-CR and comment fixes above change what an edit writes to the document, and in each case the new bytes are closer to the authored source. Source outside an edit is unchanged, and unsupported syntax is still refused.
- Links no longer grow at their ends. An inline or reference link, or an angle autolink, is now a non-inclusive mark, so text typed at either end stays outside it. Code that extended a link by typing at its end must type inside the label instead. No public method or option changed.
- Shared formatting is written once. Formatting that a link shares with the text beside it is written around both, so
**[a b](u)**plus a typedXsaves**[a b](u)X**, not[**a b**](u)**X**. Collapsed and shortcut references and autolinks are not changed. - Identical images in one paste insert once. A host that passes the same bytes twice to
pastenow gets one image.
Apps must adopt the published package separately.