Closed Droyk closed 5 days ago
Thank you for the feature request!
Let me see if I understand: this feature request concerns paste without newlines only. When pasting without newlines into an empty line, if the line directly above contains a particular style (bullets, quotes, numbers), add the same style to the pasted text.
For example,
+ bullet a
<-- paste without newlines here
+ bullet b
would yield
+ bullet a
+ pasted text without newlines
+ bullet b
Is that what you had in mind?
Question for you:
1. Line 1
<-- paste without newlines here
2. Line 2
Should this produce
1. Line 1
2. Pasted text without newlines
3. Line 2
?
(Do you want pasting without newlines onto this ordered list's empty line to change the numbers on all the other ordered list lines?)
Thankyou for responding! forgive me for my late response. So you said "this feature request concerns paste without newlines only." Nope, it doesn't! I want any type of text be it has new line, line breaks or formatted, un-formatted text to get adjusted in the existing bullet point style or whatever style is near around.
then you said "When pasting without newlines into an empty line" Please read the above
& "if the line directly above contains a particular style (bullets, quotes, numbers), add the same style to the pasted text." Exactly!
So lets modify e.g.'s a bit!
Below is the list of unnumbered bullet points
+
.................... <-- When pasting content here into a new line that becomes a parent to existing bullets,
+ the plugin should insert a single bullet point before the pasted text.
If the user has already created a bullet point, the plugin should simply paste the content
and adjust the formatting if necessary.
If the copied text have new line's or line breaks & their own bullet points,
the plugin should preserve this structure by pasting the content with its existing formatting.
This includes nesting the pasted content within the first bullet point created by the paste action, or
adjusting the indentation to match the existing parent bullet point.
rather than making a new bullet point for each new line.
would yield
+ .................
+ Lorem ipsum dolor sit amet. <-- As you can see, the pasted content had new lines
Nullam facilisis dui sit amet tellus vestibulum tempor. and they got nested into the already created second bullet
point instead of creating a new bullet point, and it pasted
Nunc non tortor sed enim tempor lobortis. into a new parent line bullet point rather than the first bullet's
In aliquam consequat neque in vulputate. child. The fourth sentence also had parent and sub bullet points,
+ Interdum et malesuada fames ac ante ipsum primis in faucibus. which got automatically nested under the main bullet point.
+ Lorem ipsum dolor sit amet. Finally, it had a parent bullet point that also got
+ Interdum et malesuada fames ac ante ipsum primis in faucibus. nested in the second user-created bullet point.
+ Et malesuada fames ac ante.
+ .................
Your last question
Do you want pasting without newlines onto this ordered list's empty line to change the numbers on all the other ordered list lines?
Absolutely yes, I would loved that! pasting content without newlines onto an empty line within an ordered list should automatically renumber all subsequent existing list items. This functionality would be even more valuable if it offered the user choices: paste with newlines (creating nested lists i.e. 1.1, 1.2, 1.3, 2.1, ..... etc) or paste without. To further enhance it, consider an additional option when one want to convert the content on those new lines a separate numbered item within the existing list. This would automatically assign numbers to each pasted new line section with the above feature it would also renumber the subsequent existing list items.
Thank you for the clarification! It's exciting to get interest from the community on my plugin.
Nope, it doesn't! I want any type of text be it has new line, line breaks or formatted, un-formatted text to get adjusted in the existing bullet point style or whatever style is near around.
The source of my confusion was the fact that "remove newlines" is focused on removing newlines from text, and you're requesting formatting newlines in pasted text. You want a plugin that integrates pasted text into obsidian/md style. This is a fairly natural feature request, of course, because it's a generalization of the task I am supporting. However, it's a significant departure from the "branding" and underlying code of this plugin. The plugin currently just strips newlines from text on the clipboard and inserts it into the editor. This new task must analyze surrounding content, determine the style, format the content in matching markdown, etc.
Fortunately, I believe there might be some great existing tooling for similar tasks. Of course, as long as you're using the right click context menu in the editor (where the commands for this plugin are), You have access to the built-in style and formatting sub-menus, which you can apply to selected text. It's really useful. On top of that, it's also fairly uncommon that you would experience said scenario:
+ bullet line
<--- nothing here
+ bullet line
because the obsidian editor does automatically insert continued styles on newlines.
+ bullet line <--- hit enter here
+ <--- auto inserted, if you paste here it will be one bullet.
If you paste multiple lines there, you can always select that text and use the right-click context menu formatting tools mentioned above.
Additionally, after I published my plugin, I did see that there are similar "text cleaner" plugins, although I do not know if they are actively supported. Advanced formatting-on-paste features you seek may already exist.
Please take a look at these options and let me know if they work for you. If not, I'd be happy to discuss possibly pivoting this plugin to more general text cleaning tasks, or starting a new project for that.
I'm going to close this for now, if that's ok. I have a half-built a general-purpose text cleaning plugin that I'm working on sporadically, I can let you know when I publish it.
Implement a functionality to ensure that pasted text adheres to the surrounding text structures. specifically, when inserted into a bullet point. The text should remain within the bullet point structure, even if it contains line breaks, new line, or new paragraphs, or additional bullet points, which should automatically become nested within the existing bullet point
so right now, it just needs to prevent exit of pasted text from bullet point structure