LoginSignup
1

More than 5 years have passed since last update.

閲覧中のページの H2 タグの内容を Markdown の見出しレベル2 にする書捨てスクリプト

Posted at

ブラウザの Dev Tool のコンソールを開いて以下を実行します

document.querySelectorAll('h2').forEach((e) => {
  console.log("## " + e.innerText);
})

例えば以下のページに対して実行する。

結果は以下になる。


## 見出し
## 見出し2
## 箇条書きリスト
## 番号付きリスト
## 引用
## 二重引用
## pre記法(スペース4 or タブ)
## code記法
## 強調:<em>
## 強調:<strong>
## 強調:<em> + <strong>
## 水平線
## リンク
## 定義参照リンク
## GitHub Flavored Markdown(GFM)
## GFM:リンクテキスト簡易記法
## GFM:取り消し線
## GFM:pre記法(チルダ×3)
## GFM:pre記法(バッククォート×3)
## GFM:pre記法(シンタックスハイライト)
## GFM:表組み
## GFM:ページ内リンク
## 参照

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1