We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a8ba70 commit 9a96433Copy full SHA for 9a96433
1 file changed
anchor/views/assets/js/editor.js
@@ -106,7 +106,16 @@
106
wrap('*', '*');
107
},
108
code: function() {
109
- wrap('`', '`');
+ var wrapping = '`';
110
+ var element = textarea[0];
111
+ var start = element.selectionStart, end = element.selectionEnd;
112
+ var value = element.value;
113
+
114
+ var selection = value.substring(start, end);
115
+ if(/\n+.*/gm.test(selection)) {
116
+ wrapping = '\n```\n';
117
+ }
118
+ wrap(wrapping, wrapping);
119
120
link: function() {
121
var element = textarea[0];
0 commit comments