0

I'm new to md and html and have been struggling with the following issue, How do I embed a link inside of a <pre> "data as per the example below" *<pre> block?

Example, I'm trying to do the following:

Folder Strcture & Content

    ├── t_databases  
    │   └── MongoDB-Go.md
    └── t_webdev
        ├── editor-Swagger.md
        └── pacenter code herekages-Go.md

and inside of the "tree" structure, I would like to embed the links to those particular directories/files. I've tried using <href> as well as the standard []() with little success.

Any help / insight will be greatly appreciated, thanks in advance

Ben
  • 41
  • 8
  • Using just MarkDown syntax, I don't think so(?) But with html `pre` tags, yes: https://stackoverflow.com/questions/13841386/is-it-possible-to-use-an-a-tag-within-a-pre-tag. The linked question points to a [jsfiddle](http://jsfiddle.net/QcaV6/1/) that also seems to work in markdown. – General Grievance Nov 12 '21 at 15:23
  • @Calculuswhiz I attempted that and it didn't work:
      ├── t_databases  
     
    It doesn't display the `html` code, but the link isn't clickable either.
    – Ben Nov 12 '21 at 15:28
  • After testing it, it seems that the href attribute has to start with `http://`. – General Grievance Nov 12 '21 at 15:30
  • @Calculuswhiz do you mind sharing your code with me please, I have it like that but with `https` which I assume should work to, but doesn't? – Ben Nov 12 '21 at 15:31
  • In your question's markdown, I was able to get it to work with `MongoDB-Go.md`, at least in the preview. – General Grievance Nov 12 '21 at 15:33
  • @Calculuswhiz I was able to to thanks, but it doesn't work for the `t_databases` entry? – Ben Nov 12 '21 at 15:35
  • What's the URL? – General Grievance Nov 12 '21 at 15:39
  • It's a GitHub repo, it seems that the issue was with copy and pasting and the `"` not being correct, thanks for all of your assitance. – Ben Nov 12 '21 at 15:46

1 Answers1

1

Thanks @Calculuswhiz for your help,

In order to do what was intended perform the following:

<pre>
    ├── <a href="https://stackoverflow.com/">t_databases</a>  
    │   └── <a href="https://stackoverflow.com/">MongoDB-Go.md</a>
    └── <a href="https://stackoverflow.com/">t_webdev</a>  
        ├── <a href="https://stackoverflow.com/">editor-Swagger.md</a>  
        └── <a href="https://stackoverflow.com/">packages-Go.md</a>  
</pre>

P.S. ensure that your inverted commas are correct " and not

Ben
  • 41
  • 8