Skip to content

Commit

Permalink
It's useful to expose replace section functions
Browse files Browse the repository at this point in the history
In case of extending text input handlers, it would be useful for users not copy/paste `replaceWithListSection`/`replaceWithHeaderSection`. For example if I just want to add a new handler to convert section to `backquote`, I can easily import replaceWithHeaderSection from this file without implementing this function again. So I propose expose these two functions.
  • Loading branch information
eguitarz committed Jun 22, 2016
1 parent 9e41d7c commit 8a5945b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/editor/text-input-handlers.js
@@ -1,6 +1,6 @@
import Range from 'mobiledoc-kit/utils/cursor/range';

function replaceWithListSection(editor, listTagName) {
export function replaceWithListSection(editor, listTagName) {
let { range: { head, head: { section } } } = editor;
// Skip if cursor is not at end of section
if (!head.isTail()) {
Expand All @@ -21,7 +21,7 @@ function replaceWithListSection(editor, listTagName) {
});
}

function replaceWithHeaderSection(editor, headingTagName) {
export function replaceWithHeaderSection(editor, headingTagName) {
let { range: { head, head: { section } } } = editor;
// Skip if cursor is not at end of section
if (!head.isTail()) {
Expand Down

0 comments on commit 8a5945b

Please sign in to comment.