1

I would like to do something like this:

```swift
let <a href="#">someVar</a> = "foo"
```

in Jekyll, and have it show up as a highlighted block of Swift code, where someVar can be clicked and go to #. Currently the tag is printed and visible instead. I know it's not exactly what the syntax highlighting feature in Jekyll is for, but is it possible in any way to add links to highlighted code blocks, without manually highlighting myself? Is there perhaps some other GitHub Pages-compatible plugin that could do this?

Eugene
  • 3,417
  • 5
  • 25
  • 49

2 Answers2

2

Looking at the code, there doesn't seem to be any way to escape code formatting inside a Jekyll Rouge highlight Liquid block to either to go back out to markdown parsing, or to insert raw HTML.

lotyrin
  • 192
  • 8
0

Another approach would be to use JavaScript to parse the content of your HTML and substitute in a link whenever you see the corresponding tag.

More info: Replace words in the body text

Kevin Workman
  • 41,537
  • 9
  • 68
  • 107