nodebb-plugin-markdown 12.1.1 → 12.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-markdown",
3
- "version": "12.1.1",
3
+ "version": "12.1.3",
4
4
  "description": "A Markdown parser for NodeBB",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -160,10 +160,10 @@
160
160
  textarea, selectionStart + 3, selectionStart + strings.list_item.length + 3
161
161
  );
162
162
  } else {
163
- var wrapDelta = controls.wrapSelectionInTextareaWith(textarea, '\n* ', '');
164
- controls.updateTextareaSelection(
165
- textarea, selectionStart + 3 + wrapDelta[0], selectionEnd + 3 - wrapDelta[1]
166
- );
163
+ const selectedText = $(textarea).val().substring(selectionStart, selectionEnd);
164
+ const newText = '* ' + selectedText.split('\n').join('\n* ');
165
+ controls.replaceSelectionInTextareaWith(textarea, newText);
166
+ controls.updateTextareaSelection(textarea, selectionStart, selectionEnd + (newText.length - selectedText.length))
167
167
  }
168
168
  });
169
169
 
@@ -4,7 +4,7 @@
4
4
  background-color: inherit;
5
5
  border: none;
6
6
  code {
7
- width: 100%;
7
+ min-width: 100%;
8
8
  }
9
9
  code[data-lines="1"] {
10
10
  white-space: normal !important;