github / github/paste-markdown

Support pasting more HTML elements

Đang mở
#67 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
234
Fork
47
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
5

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Review the html-to-markdown spike and the linked Google Doc test cases first. Compare existing paste-markdown behavior with the listed HTML elements and define coverage for headings, code, emphasis, lists, and quotes; done means those clipboard inputs produce the intended Markdown without regressing existing special cases.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
html, javascript, markdown
Lĩnh vực
frontend
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.