Skip to content

Instantly share code, notes, and snippets.

@kojp
Last active October 19, 2022 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kojp/e8a0fa1b4719e3147978b38f615d787b to your computer and use it in GitHub Desktop.
Save kojp/e8a0fa1b4719e3147978b38f615d787b to your computer and use it in GitHub Desktop.
ウェブページの選択範囲(テキスト)とタイトルをLogseqに貼り付けるスタイルに整形するブックマークレット(空行ができないバージョン)。Logseqのプラグイン“Paste More”と併用する必要があります。詳しい説明→ https://ich.hatenadiary.com/entry/logseq-bookmarklet
javascript: (function () {var markdown = "[" + document.title + "](" + window.location.href + ")";var selection = window.getSelection().toString();array = selection.split(/\n/);c = window.open();c.document.open();c.document.write(markdown + "<br />");for (j = 0; j < array.length; j++) {if (array[j] != "") {c.document.write("&nbsp;&nbsp;&nbsp;&nbsp;" + "- >" + array[j] + "<br />");} else {c.document.write("&nbsp;&nbsp;&nbsp;&nbsp;" + array[j] + "<br />");}}})();
@kojp
Copy link
Author

kojp commented Jun 10, 2022

Logseqに貼り付けると、空行は消されます(Logseqのバージョン0.7.2時点)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment