[URL:title=escaped]
by
noromanba
2018-06-05 [2018/06/05 22:01:36]
prompt escaped title with Hatena Syntax
-
/*
* @title [URL:title=escaped]
* @description prompt escaped title with Hatena Syntax
* @include http://*
* @include https://*
* @license MIT License https://nrm.mit-license.org/2012
* @javascript_url
*/
// e.g.
// - [https://example.com:title=this is [example] domain]
(() => {
// EUC-JP -> H::D, H::H et al.
// Character Entity Reference c.f.
// https://dev.w3.org/html5/html-author/charref
const escaped = document.title.replace(/\[/g, '[').replace(/\]/g, ']');
const syntax =`[${location.href}:title=${escaped}]`;
window.prompt('Copy Me', syntax);
})();
-
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。