MLH-Fellowship / 0.2.1-readme-dirs

A web application that generates helpful project structures for public GitHub repositories
https://project-structure-readme.netlify.app/
MIT License
1 stars 1 forks source link

Write functionality to copy "tree printout" with "markdown hack" #26

Closed nchaloult closed 4 years ago

nchaloult commented 4 years ago

In Markdown, you can't include relative links inside of code snippet blocks (blocks surrounded with ```). The only way you can get GitHub to render sections of a markdown file with a monospaced font is to put that section in a code snippet block.

We were at a crossroads, until @ralph-dev came to the rescue with a neat GitHub markdown hack! If you surround a code snippet block with <big><pre> ... </pre></big>, then you can coerce GitHub to render your snippet with a monospaced font while maintaining support for relative links!

This PR adjusts the functionality of the "markdown display box"'s "copy to clipboard" button: this button copies text surrounded by those <big> and <pre> tags to the user's clipboard. This way, users can paste what they've copied right into a markdown file, and everything will look and behave as expected