Skip to content

0.0.5

Latest
Compare
Choose a tag to compare
@bastianallgeier bastianallgeier released this 17 Jul 19:55

New features

  • new autofocus option for the Writer
  • new triggers feature, which lets you define commands based on input combinations at the beginning of the text. Here are some examples.
const writer = Writer(".writer", {
    triggers: {
        "/": () => {
            // open the command dropdown (take Notion as example)
        },
        "# ": () => {
            // convert the entire block to a h1 - markdown style
        },
        "- ":() => {
           // convert the block to a list item - markdown style as well
        }
    }
});
  • new writer.focus(position) method. This is especially cool because you can either "just" focus the element, focus at a specific position with writer.focus(4) or use start and end as position keywords: writer.focus("end")

Enhancements

  • massively enhanced HTML parser and white space removal
  • Pasted headings are now marked as bold elements
  • More tests

Fixes

  • Fix pasting content when text is already selected