GithubHelp home page GithubHelp logo

zolrath / obsidian-auto-link-title Goto Github PK

View Code? Open in Web Editor NEW
405.0 7.0 53.0 184 KB

Automatically fetch the titles of pasted links

License: MIT License

TypeScript 97.31% JavaScript 2.63% CSS 0.06%
obsidian-md obsidian-plugin

obsidian-auto-link-title's Introduction

Obsidian Auto Link Title

Auto linking example

Automatically Title New Links

This plugin automatically fetches the webpage to extract link titles when they're pasted, creating a markdown link with the correct title set.

For example:

When pasting https://github.com/zolrath/obsidian-auto-link-title the plugin fetches the page and retrieves the title, resulting in a paste of: [zolrath/obsidian-auto-link-title: Automatically fetch the titles of pasted links](https://github.com/zolrath/obsidian-auto-link-title)

Add Titles To Existing Raw URLs

Additionally, using ctrl-shift-e (Windows) or cmd-shift-e (OS X) you can enhance an existing raw link to a markdown formatted link with the proper title.

If your text cursor is within the url https://github.com/zolrath/obsidian-auto-link-title pressing ctrl-shift-e or cmd-shift-e converts the text to [zolrath/obsidian-auto-link-title: Automatically fetch the titles of pasted links](https://github.com/zolrath/obsidian-auto-link-title)

Overwrite Titles Of Existing Markdown Links

Additionally, using ctrl-shift-e (Windows) or cmd-shift-e (OS X) you can overwrite an existing title of a markdown link with the fetched title from the url.

If your text cursor is within [some plugin](https://github.com/zolrath/obsidian-auto-link-title) pressing ctrl+shift+e fetches the sites title and replaces it, resulting in [zolrath/obsidian-auto-link-title: Automatically fetch the titles of pasted links](https://github.com/zolrath/obsidian-auto-link-title)

Mobile Pasting

In order to paste the URL ensure you perform the Tap and Hold -> Paste action to paste the URL into your document.

Gboard

Google's Gboard keyboard has a Clipboard helper shortcut above the keyboard to quickly paste. Due to the implementation of that feature, it does not trigger the paste event, preventing this plugin from interacting with the text.

obsidian-auto-link-title's People

Contributors

jamiekowalski avatar jmilldotdev avatar khaosdoctor avatar krakor92 avatar kxxt avatar mkrcah avatar neoromantic avatar ruimage avatar ryotaushio avatar tswwe avatar xrain777 avatar zolrath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

obsidian-auto-link-title's Issues

Google Doc titles

This plugin helps greatly make Obsidian a more readable platform.

Currently, Google Docs links are giving the generic title: "Google Docs – create and edit documents online, for free"

It would be great to pull the document title. Most clippers are able to do that.

Much appreciated.

Escape special characters in URLs when title isn't parsed

When pasting a URL like https://twitter.com/_underscore, the plugin substitutes [https://twitter.com/_underscore](https://twitter.com/_underscore). The problem is Obisdian interprets the underscore as a Markdown character and renders the latter half of the link as italic. The plugin should escape characters like _ and * when putting raw URLs into titles.

Trim white space characters from both ends of the title

Thank you for a super useful plugin...

I've had a few cases recently where whitespace characters have ended up at the start or end of the titles, and I trim them by hand.

It's not a big deal, but I wondered if it would be possible for the plugin to remove them automatically. I can't think of any situation where they would be useful.

Examples, as generated by the plugin:

Source of the above links:

- [\n    Archives | CSS-Tricks](https://css-tricks.com/archives/)
- [\r\n\tHoliday at Nicolle Tower in St Clement, Jersey | The Landmark Trust\r\n](https://www.landmarktrust.org.uk/search-and-book/properties/nicolle-tower-9638/#Overview)

There are also some links that cannot be obtained, and the problem of abnormal acquisition

High CPU usage when can't fetch title

Sometimes when pasting an URL the plugin is not able to fetch the title. The obsidian process that is created will continue to work until manually terminated. Single unfetched title adds around 8% CPU workload in my case.

Would be nice if process would kill itself automatically if it runs for more than few seconds

NbUXZR0p4Q
Obsidian_aEoSMf5sg1

Crashes on pasting links

I've had Obsidian crash a few times just after pasting a hyperlink.
I also can't narrow it down to specific sites, ( I recall a link to Zenodo.com, or a shortcode url for example)

I can only imagine that problems were created by an obsidian update - since this plugin did not update recently.

Maybe others had a similar experience?

edit:
Crashed after pasting this URL: https://www.integromat.com/en
Opened Obsidian again, (the link text was stuck on "fetching title"), pasted again - crashed again.

YouTube links don't work anymore

They used to be fine, but now YouTube channel or video links don't yield a real title but Before you continue to YouTube.

Links used: https://www.youtube.com/teded, https://www.youtube.com/watch?v=xy9nj94xvKA.

It looks like YouTube's cookie consent page's title for when you first open the site in a browser.

image

Will replace text at tops of other pages with link title

Occurs when I move to another page when the link is being fetched. Has also occurred sometimes, when I click somewhere when the link is being fetched.

Some text, at the top few lines of the page will be replaced with the title of the link and the link itself will remain "fetching title"

No title fetching on mobile

I've recently noticed that link paste action doesn't fully work on my Obsidian iOS version. I'm saying fully because whenever I paste a link, it's pasted with Markdown link formatting but there's no title fetching happens. Text part just stays blank.

I've tried waiting and checking if there might be something else causing an issue but everything seems fine. I'm not sure if it's a mobile limitation or a bug but I'd like to have this plugin working as intended on my phone too.

Copy Paste (using shortcut) not working when Plugin Enabled

Bug Description

  • When Auto Link Title is enabled the Copy Paste shortcut (Ctrl + C followed by Ctrl + V) is not working
  • When copy pasting manually using the Right Click menu option the feature works as expected
  • If any text is copied using the menu option every subsequent copy paste will only paste the text selected using the menu option

Bug Demonstration

bug_demo.mp4

Titles are mixed when two or more links are being fetched

Hi everyone, I'm a obsidian user from China and I really appreciate this useful plugin. However, as you may know, the network connections to some specific websites are not quite good here, so I have to wait for the titles.

I noticed that if there're two or more links are in fetching stages, they'll finally get the same title as the one fetched early. For example, I'm fetching the titles of a.example.org and b.example.org, and if the title of a.example.org arrives first, both of the titles will be that one. I think some sort of isolation mechanism will help. Again, thank you for developing this awesome plugin!

Unrecognized link exists

[Feature Request] Arbitrary post-processing of title

It would cool if there were a setting which consisted of a JavaScript code-block that would allow us to post-process the title before it's pasted into the document. This is useful for GitHub link titles which are long and have too much information for my taste.

So a setting that would allow me to define a hook like the following:

(url, title) => {
  if (/github\.com/.test(url)) {
    return title.replace(/^GitHub - ([^:]+):.*/, '$1');
  }
  return title;
}

Avoid replacing selected text

Hey! Great plugin!

I am using "Paste URL into selection" Obsidian plugin, and I would like to use this plugin in conjunction with it. However "Auto Link Title" replaces selected text, and seems to overwrite the behaviour of the other application. Could you consider changing this behaviour for selected/highlighted text?

Link to the mentioned plugin:
https://github.com/denolehov/obsidian-url-into-selection

Editing name manually bug

Fetching of some titles works slowly for.
At several particular sites I store links from this process takes enough time for me to go to the page, copy the link name I need, return to Obsidian and paste it instead of 'fetching code' manually. And when the plugin does finally insert the fetched name, it gets pasted in the beginning of my note — because there is no more code to be replaced by it (and generally I do not like the name pattern that this site uses and will replace the name anyway).
So, please:

  1. #6 — this would have solved my issue
  2. Do not paste the name when there is no code found in the note :)
    Thus said, I love the plugin very much, because when it works — it works, and saves time.

Takes over Ctrl+v

Have a weird issue where plugin replaces my regular ctrl+v pastes. Have tried changing the keyboard shortcut, restarting, uninstalling. Using Windows v0.12.12.

Multiple LInk

Can you please support convert multiple link with a line break between them . so that i can convert multiple links at one time

disable auto-link in code blocks

Similar to disabling the plugin when pasting into yaml frontmatter (#21), the plugin should also be disabled when pasting into a code block.

Bad behaviour when I want past an url in the search field.

For search purpose ( ctrl+f or ctrl+maj+f )
I need to be able to paste an url in the search box but when I paste the url, the editor capture the action and the url text is paste on the opened md document...
Thanks you for this good job !

Fetching Title doesn't work when the url doesn't include https:// before

cmd+shift+e is the shortcut to add a title to the link, however, it seems that it doesn't work when the url doesn't include "https://" before.

www.youtube.com => cmd+shift+e => [Fetching Title#97u3](www.youtube.com)

but as soon as I add another link after:
https://www.youtube.com => cmd+shift+e => [Before you continue to YouTube](https://www.youtube.com)

The first link is updated: [Before you continue to YouTube](www.youtube.com)

[Feat] Pasting multiple URL's at once

Would it be possible to replace all the URL's when pasting instead of just 1 link at a time? Maybe this could just be a special command to avoid delays.

occasional occurrence of site unreachable problem.

problem : sometimes when my connection to certain web url is slow, it shows site unreachable. then, when the internet connection is better, it fetches the title correctly.

possible solution: increase the threshold maximum value for title fetching time.

[feature request] Extracting the URL title through scripts.

Extracting the URL title through scripts. I want in particular to use it along with templater to automate some note captures on mobile. i.e. create a new note from a template , paste the URL and get a new note with from the title of the URL. Is this possible?

Link fetching doesn't work in vim's normal or visual mode

I use Obsidian's vim mode.

When I paste a link (p) in visual or normal mode the title is not fetched.

It only works if I am in insert mode and past via Ctrl+v.

Is there a workaround for this or is this an inherent limitation in Obsidian's implementation of vim?

Disable auto-link title when pasting into Frontmatter

Currently the auto-linking happens whenever a link is pasted anywhere in the note. It would be great if a setting could be added to disable auto-linking when pasting into the Frontmatter section of the note.

Thanks for your work on this plugin!

Feature request: Retrieve title for existing links

Thank you very much for this awesome plugin! ❤️ Surprisingly big QOL improvement.

I have tons of old links without title, or with very lazy titles. I would love if I could automatically update/replace the titles with the help of this plugin. For example, an option could be added to the right click context menu for this.

[feature request] Exclude url list

Could you support exclude url list in option?
I often paste comapany internal url in .md, but auto-link-tilte can not reach and fetch the title.

Fail on Recognizing URLs Containing Specific Strings

Hi, I noticed that this plugin will miss a URL if it has a string like 'ai' in the middle of it. For example:

  • it goes well with this one: https://www.a.com
  • but this one will be missed: https://www.ai.com

After skimming through the code, I think this problem has something to do with the regex expression matching image files. Later I will submit a PR to try to fix it, but I am not sure whether it would introduce any new problem. Feel free to reject the PR if anything gets worse.

Link Titles on secure sites

Anyway to configure this plugin to use auth? When working on secure pages (with Edge) the link titles fail since this plugin is not using the login cookie.

Disable auto-link when pasting over a text

If I copy a URL, highlight a text to link it, and paste the URL, the plugin replaces my selection with the link which means that I then need to go and rewrite the title. This is super annoying.

A better approach would be for the plugin to respect the selection and use it instead of the fetched title.

Linked YouTube videos start playing in the background

YouTube videos start playing sound in the background for about a second after pasting their link. Happens around 1/3 of the time. Example link: https://www.youtube.com/watch?v=xy9nj94xvKA. I'm on 1.2.5 of the plugin, Obsidian v0.13.19, Windows 10.

Is it meant to create databases for sites with Facebook widgets?

Okay, so this is a weird one. Every time I run a link to a page with an embedded Facebook widget in it, a database is created in the Obsidian config directory. In the example below, aresaflowers.com, helstonrailway.co.uk and (I guess) youtube.com are the ones I mean:

laura@lauralaptop:~/.var/app/md.obsidian.Obsidian/config/obsidian/IndexedDB$ ls -hl
total 0
drwx------ 1 laura laura 152 Apr 15 19:28 app_obsidian.md_0.indexeddb.leveldb
drwx------ 1 laura laura 112 Apr 15 14:48 app_static.obsidian.md_0.indexeddb.leveldb
drwx------ 1 laura laura  78 Apr  1 01:40 https_www.arenaflowers.com_0.indexeddb.leveldb
drwx------ 1 laura laura  92 Apr 15 21:58 https_www.helstonrailway.co.uk_0.indexeddb.leveldb
drwx------ 1 laura laura  98 Apr  1 01:31 https_www.youtube.com_0.indexeddb.leveldb

Is that expected behaviour? I've tested by watching the timestamps update by going to helstonrailway.co.uk and it definitely happens when I run "paste and auto fetch title".

Here is the top of one of the log files inside the database directory above:

laura@lauralaptop:~/.var/app/md.obsidian.Obsidian/config/obsidian/IndexedDB/https_www.helstonrailway.co.uk_0.indexeddb.leveldb$ cat 000003.log 
� 6>
F��Тw�"https_www.helstonrailway.co.uk_0@1EappsFacebookFeedCacheOf�j2

2�������

Infuriatingly, I can't replicate this in the sandbox vault with just your plugin installed. And yet, if I use my main vault with all plugins disabled except this one, and with the default theme, the phenomenon still occurs! Weird!

Any ideas? Thanks for your help!

Disable auto-link on ctrl-shift-v

Sometimes the titles are not meaningful, so it would be good to have a simple way of undoing or preventing auto-linking. This is usually possible with shift-paste. It would be great to have that for this plugin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.