github / github/paste-markdown

Support pasting more HTML elements

Aperta
#67 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
234
Fork
47
Merge medio
1g 12h
PR unite (30g)
5

Descrizione

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 ❇️

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.