github / github/paste-markdown

Support pasting more HTML elements

オープン
#67 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
234
フォーク
47
平均マージ
1日 12時間
マージ済み PR(30日)
5

説明

This was originally an issue by @imjohnbo in `github/special-projects`, a private repository:

> ## Summary
>
> Today, content is pasted into GitHub comments (issues, PRs, discussions, etc) as plaintext, except for a [few special cases](https://github.com/github/paste-markdown#paste-markdown-objects) managed by [`@github/paste-markdown`](https://github.com/github/paste-markdown).
>
> It's a laborious process to add formatting and links of the copy source back into the paste target. For example:
> - Copying/pasting part of a GitHub comment into a GitHub comment box – maybe in a different issue – in order to reply to it
> - Copying/pasting part of a Google Doc shared with a customer into a GitHub comment box in order to add context to it
> - ...
>
> This issue would build on https://github.com/github/special-projects/issues/679 and investigate adding Slack-like paste functionality for the features GitHub developers care about, including:
>
> | name | html | markdown |
> |-----------------|----------------|----------------------|
> | headings | `

`, `

`... | `#`, `##`, etc. |
> | inline code | `` | \``code`\` |
> | code block | `
`    |         \`\`\``code`\`\`\`             |

> | bold | `` | \*\***bold**\*\* |
> | italics | `` | \**italics*\* |
> | ordered lists | `
  1. ` | 1. item |
    > | unordered lists | `
    • ` | - item |
      > | task lists | ? | - [x] completed item |
      > | quotes | `blockquote` | > a long quote |
      >
      > ## Example
      >
      > This Google Doc:
      >


      >
      >


      >
      > is pasted as:
      >
      > ```
      > Big Heading
      > Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eleifend consectetur nisl, vel vestibulum odio mattis sit amet. Integer vehicula rhoncus augue, eu congue magna porttitor eget.
      > Medium Heading
      > Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eleifend consectetur nisl, vel vestibulum odio mattis sit amet. Integer vehicula rhoncus augue, eu congue magna porttitor eget.
      > Small Heading
      > Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eleifend consectetur nisl, vel vestibulum odio mattis sit amet. Integer vehicula rhoncus augue, eu congue magna porttitor eget.
      > ```
      >
      > when I would like it to be:
      > ```
      > # Big Heading
      > Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eleifend consectetur nisl, vel vestibulum odio mattis sit amet. Integer vehicula rhoncus augue, eu congue magna porttitor eget.
      > ## Medium Heading
      > Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eleifend consectetur nisl, vel vestibulum odio mattis sit amet. Integer vehicula rhoncus augue, eu congue magna porttitor eget.
      > ### Small Heading
      > Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eleifend consectetur nisl, vel vestibulum odio mattis sit amet. Integer vehicula rhoncus augue, eu congue magna porttitor eget.
      > ```
      >
      > ## Spike
      >
      > I started [a spike](https://github.com/imjohnbo/paste-markdown/tree/imjohnbo/html-to-markdown) over the weekend which allows for this:
      >
      > ![paste](https://user-images.githubusercontent.com/2993937/150845376-8e6ac27d-01c1-4ab9-b1b5-db05bbede328.gif)
      >
      >
      > ## Other
      >
      > - [Pasteboard Viewer](https://apps.apple.com/us/app/pasteboard-viewer/id1499215709?mt=12) helps understand what's in the macOS clipboard
      > - Here is a [Google Doc](https://docs.google.com/document/d/1dRgAa3MLK6U0HjFnvDXBP-gjdSCCatgCVDe89KPqnz8/edit?usp=sharing) with some test cases for convenience ❇️

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。