obsidian-clipper icon indicating copy to clipboard operation
obsidian-clipper copied to clipboard

Can't find a heading other than H1

Open trustin opened this issue 2 years ago • 6 comments

I specified Clippings in 'Daily/Weekly Note Position' field of the plugin preferences and added ## Clippings to the daily/weekly note template. However, the plugin fails to find the heading, probably because it only looks for level-one heading (# Clippings).

It'd be nice if the plugins looks for the heading at the second level as well, given that the first level is usually for a page title.

trustin avatar May 15 '23 10:05 trustin

I will look into adding support for this. This can make things tricky when trying to support appending/prepending within a configured Header because previous clipped content could contain headers (h1, etc).

I currently allow the Markdown headers within clipped data to be configured and I always set my H1 to render as ##.

Let me think about this a bit more.

jgchristopher avatar May 15 '23 17:05 jgchristopher

How about increasing the levels of all headings in the clipped content by N, where N is the level of the position heading?

trustin avatar May 16 '23 06:05 trustin

I like this idea. I will play around with it and see if it works out.

jgchristopher avatar Jun 20 '23 14:06 jgchristopher

Just adding a ➕ to this. I can't get it to find even H1 headings and get the error whether the heading is, e.g., # Clippings or ## Clippings. I re-downloaded the personal plugin after each change, so I'm guessing that the correct settings got transferred.

benvenker avatar Jul 19 '23 14:07 benvenker

@benvenker just want to make sure, but you are not putting the # in the field are you? Right now you just put in the heading value Clippings and it will only look for an H1 with the value Clippings.

jgchristopher avatar Jul 19 '23 18:07 jgchristopher

This support is being added in the version 1 release. If you are using a header, it will support setting the level of header you want to use. It will also create the header if it can't find the header.

jgchristopher avatar May 30 '24 16:05 jgchristopher