[URL:title=escaped]

    @@ -3,21 +3,20 @@ * @description prompt escaped title with Hatena Syntax * @include http://* * @include https://* - * @license MIT License http://nrm.mit-license.org/2012 - * @require + * @license MIT License https://nrm.mit-license.org/2012 + * @javascript_url */ -// # NOTE -// Hatena::Diary unhandle square brackets '[', ']' within http syntax with title + // e.g. -// - [http://include.square.brackets.in/title:title] -// - [http://example.com:title=this is [example] domain] +// - [https://example.com:title=this is [example] domain] -(function () { - // H::D use euc-JP, i.e. unwork entities. oops.. - // Hatena::Group and Hatena Blog use UTF-8, works well - //var escaped = document.title.replace(/\[/, '[').replace(/\]/, ']'); - var escaped = encodeURI(document.title); - var syntax ='[' + location.href + ':title=' + escaped + ']'; +(() => { + // 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}]`; - prompt('Copy Me', syntax); + window.prompt('Copy Me', 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 です。

History

  1. 2018/06/05 22:01:36 - 2018-06-05
  2. 2013/01/29 08:25:07 - 2013-01-29
  3. 2013/01/29 08:16:28 - 2013-01-29
  4. 2013/01/29 08:16:18 - 2013-01-29
  5. 2013/01/29 08:15:53 - 2013-01-29
  6. 2011/09/16 06:19:29 - 2011-09-16
  7. 2011/09/16 06:17:43 - 2011-09-16
  8. 2011/06/24 06:18:57 - 2011-06-24
  9. 2011/06/24 06:16:49 - 2011-06-24
  10. 2011/06/24 06:14:13 - 2011-06-24
  11. 2011/06/24 06:12:14 - 2011-06-24
  12. 2011/06/24 05:47:48 - 2011-06-24
  13. 2011/06/24 05:46:09 - 2011-06-24
  14. 2011/06/24 05:44:16 - 2011-06-24