Skip to content

Improve code snippet preview #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adangel opened this issue Jul 16, 2021 · 1 comment · Fixed by #100
Closed

Improve code snippet preview #94

adangel opened this issue Jul 16, 2021 · 1 comment · Fixed by #100
Labels
enhancement New feature or request
Milestone

Comments

@adangel
Copy link
Member

adangel commented Jul 16, 2021

In order to copy the code snippet, it would be useful to

  • have a copy-to-clipboard button
  • render the snippet with line numbers in a table, so that the code without the linenumbers can be selected easily. the problem:
    grafik

Github renders this as a table, and the selection is easy:

grafik

So, we probably should not render the snippet as a single pre, but as e.g.

<table>
 <tr>
   <td>263</td>
   <td><code>         for (int i = srcBegin + (1 >> LO_BYTE_SHIFT); i < srcEnd; i += 2) {</code>
 </tr>
 <tr>
   <td>264</td>
   <td><code>             dst[dstBegin++] = value[i];</code>
 </tr>
 <tr>
   <td>265</td>
   <td><code>         }</code>
</tr>
</table>
@adangel adangel added the enhancement New feature or request label Jul 16, 2021
@adangel
Copy link
Member Author

adangel commented Dec 4, 2021

Also I noticed, that the highlight doesn't work anymore....

adangel added a commit to adangel/pmd-regression-tester that referenced this issue Dec 4, 2021
@adangel adangel added this to the 1.2.1 milestone Dec 4, 2021
adangel added a commit that referenced this issue Dec 17, 2021
Improve code snippet preview #100

* pr-100:
  Update release notes (#94)
  Add copy to clipboard button
  Render code snippet as table
  Fix highlighting of violation line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant