greghendershott/frog

Code highlighting inside of a <details> tag?

hebr3 opened this issue · 5 comments

hebr3 commented

I am trying to highlight code inside of a detail block. It seems to work fine in github markdown however, frog doesn't seem to do any conversion to the code inside of the details tag.

Do I need to write a custom widget function to do this, or is there a built in function already?

Code

<details>

```racket
(define (sqr x)
(* x x))
```

</details>

Github markdown

(define (sqr x)
  (* x x))

frog markdown

racket (define (sqr x) (* x x)) (define (cube x) (* x x x))

Thanks for reporting. This is almost certainly due to the markdown parser used by frog. But I also wrote that, so I'm not dodging this. I logged an issue there.

@hebr3 I have a commit to add this. Are you still interested? If you will definitely use it, I'll merge it and refresh both the markdown library and frog on the Racket package server.

(Otherwise, I might keep this on ice until/unless someone chimes in to say they definitely need it.)

hebr3 commented

It would be helpful. As a work around I manually added the tags to the html file after frog did the conversion.

I'm not going to use it in every post so if it would be a hassle you can put it off until later.

It looks like the Racket package server has refreshed with this now, so you can update Frog and its dependencies: raco pkg update --update-deps frog. (The --update-deps will ensure that it fetches the newer markdown package, which is the substance of the change.)

p.s. That's weird, the GitHub UI is currently saying that I closed this issue, but not showing the link to the commit that closed it. For the record, it was commit fe40865.