From 8a5945b07b3e585daa00917ccfc6c8e27e290f68 Mon Sep 17 00:00:00 2001 From: Dale Ma Date: Tue, 21 Jun 2016 22:25:05 -0700 Subject: [PATCH] It's useful to expose replace section functions 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. --- src/js/editor/text-input-handlers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/editor/text-input-handlers.js b/src/js/editor/text-input-handlers.js index d102b58d1..826398f6c 100644 --- a/src/js/editor/text-input-handlers.js +++ b/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()) { @@ -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()) {