github / github/paste-markdown

Support pasting more HTML elements

未关闭
#67 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
234
派生
47
平均合并
1 天 12 小时
30 天内合并 PR
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 ❇️

贡献指南

打开贡献指南

调研方向

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.

由索引模型根据 Issue 内容生成。

评估

技术栈
html, javascript, markdown
领域
frontend
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。