- FormatLink.safariextz
- Safari 12+ does not allow unsafe extensions, you need to build the extension yourself
- Or build the extension yourself: Safari Develop -> Show Extension Builder
To format the link of the active tab instantly to use in Markdown, Textile or other formats.
- Press the toolbar icon of "Format Link".
- When a popup opens, press Command-C to copy the formatted link to the clipboard.
Also you can change the format for one time only with selecting the format in the dropdown list.
You can modify formats in [Safari]/[Preferences] -> [Extensions]. In format settings, you can use the mini template language.
- {{variable}}
- variable = title / url
- No spaces are allowed.
- {{variable.s("foo","bar")}}
- Which means variable.replace(new RegExp("foo", 'g'), "bar")
- You can use escape character \ in strings.
- You must escape the first argument for string and regexp. For example, .s("\[","\[") means replacing [ with \[
- You can chain multiple .s("foo","bar")
- You can use the escape character \
- Other characters are treated as literal strings.
Here are examples:
- Markdown
[{{title.s("\\[","\\[").s("\\]","\\]")}}]({{url.s("\\)","%29")}})
- Redmine Textile
"{{title.s("\"",""").s("\\[","[")}}":{{url}}
- HTML
<a href="{{url.s("\"",""")}}">{{title.s("<","<")}}</a>
- Text
{{title}}\n{{url}}
MIT License. Source codes are hosted at Github
I synthesized two icons (a pencil and a link) to produce Icon.png
.
- A pencil icon from Onebit free icon set © 2010 Khodjaev Stanislav, used under a License: These icons are free to use in any kind of commercial or non-commercial project unlimited times.
- A link icon from Bremen icon set © 2010 Patricia Clausnitzer, used under a Creative Commons Attribution 3.0 License