Commit 6bf7b8c9 authored by Michael Murtaugh's avatar Michael Murtaugh

back on master

parents 2691bc2f e6fcc692
This diff is collapsed.
......@@ -307,6 +307,9 @@ class CCEditor {
getValue () {
return this.editor.getValue();
}
getSelection () {
return this.editor.getSelection();
}
replaceSelection (text) {
this.editor.replaceSelection(text);
}
......
......@@ -271,14 +271,16 @@ class CCEditorApp {
function paste_link (state) {
var ev = editor.getValue();
// console.log("ev", ev);
// console.log("paste_link");
var thereflinks = reflinks.extract_reflink_definitions(ev);
var href = state.href;
if (state.hash) {
href = cceditor.parse_fragment(state.href).base + state.hash
}
// var curtext = editor.getSelection();
// console.log("curtext", curtext, curtext.search(/\n/));
href = reflinks.compactRefLink(href, thereflinks);
editor.replaceSelection("["+href+"]\n");
editor.replaceSelection("["+href+"]");
}
// Listen for pastelink events
......
......@@ -2,7 +2,7 @@ const path = require('path');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
module.exports = {
entry: './src/cceditorapp.js',
mode: 'production', // 'development', production
mode: 'development', // 'development', production
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'cceditorapp.js',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment