Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Selecting text and converting it? #4

Closed
KeesCBakker opened this issue Jan 20, 2022 · 1 comment
Closed

Selecting text and converting it? #4

KeesCBakker opened this issue Jan 20, 2022 · 1 comment

Comments

@KeesCBakker
Copy link

KeesCBakker commented Jan 20, 2022

Awesome extension. Love the way it inserts ordered and unordered lists.

I was wondering if we can add a new feature. I would love to be able to select text and turn it into a list. Like:

2 niet al te grote appels
40 gr rozijnen
2 eetlepels suiker
1 theelepel kaneel

Press some sort of a shortkey and it turns the lines into:

- 2 niet al te grote appels
- 40 gr rozijnen
- 2 eetlepels suiker
- 1 theelepel kaneel

Would that be possible?

@robole
Copy link
Owner

robole commented Jan 20, 2022

hi @KeesCBakker

I am glad you like the extension.

This extension only provides keyboard shortcuts to existing markdown snippets. It is not the objective of the extension to add snippets or more functionality beyond that.

The insert unordered list snippet is a builtin snippet (found here) that has the functionality you are using . This snippet only inserts a new list. This is the actual snippet:

"Insert unordered list": {
		"prefix": "unordered list",
		"body": [
			"- ${1:first}",
			"- ${2:second}",
			"- ${3:third}",
			"$0"
		],
		"description": "Insert unordered list"
	},

It is not possible for a snippet to read the text from the clipboard and tokenize the text to insert a dash before each line. You need to write some JS/TS code for this functionality.

I wrote another extension called Marky Edit that provides more advanced markdown editing functionality such as this. I suggest you try that instead. It has a Marky Edit: Toggle Unordered List (Bulleted List) that provides the functionality you desire. However, you will need to add your own keyboard shortcuts to these commands yourself to use them in the same way.

All the best

Rob

@robole robole closed this as completed Jan 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants