github / github/paste-markdown

Support pasting more HTML elements

Abierto
#67 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
234
Forks
47
Merge medio
1 d 12 h
PR fusionados (30 d)
5

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.