git ssb

30+

cel / git-ssb-web



Support Clojure(Script) for code highlighting

%eu+i7Un6uHDk6rGfspskRIJodQV1gQUuYryLvVeWtSA=.sha256
OpenVictorBjelkholm (lasoa) opened this issue on 1/18/2020, 2:48:22 PM

Support Clojure(Script) for code highlighting

For an example, see http://localhost:7718/%25xv4vfntoOVPpYwA3w2mV6T2mdYRrli7cAI21YGL28kA%3D.sha256/blob/74e6a9efcd58175b0b939fbc958cf2f8a77597ba/src/metabutt/core.cljs which currently doesn't have any highlighting.

Took a quick look to see if I could submit a patch for adding it, but not finding where the highlighting is happening.

If someone can point me in the right direction, I can give it another try.

%8PKUgQOSSOg1H6M44TTqYDj4rbBJWzBnXyFKIwoLAB0=.sha256 VictorBjelkholm (lasoa) · 1/18/2020, 2:52:46 PM

So, seems clojure code is support (.clj [but also has extension .cljc in some cases]), but is missing .edn and .cljs

If we can set .cljc, .cljs, .edn to all finally resolve to .clj, everything would work.

Seems like http://localhost:7718/%25q5d5Du%2B9WkaSdjc8aJPZm%2BjMrqgo0tmfR%2BRcX5ZZ6H4%3D.sha256/blob/e095c75a1ef7824b16689d3ef626435a90ca42ca/lib/util.js#L118 would be the right place to resolve this, but unsure of the appropriate way to implement.

First idea to have a map that maps extension to extension, and do a lookup in the highlight function. Map would look something like:

{".cljs" ".clj"
 ".cljc" ".clj"
 ".edn" ".clj"}
punkmonk · 5/24/2020, 5:22:50 PM
{
  "type": "issue-label",
  "project": "%q5d5Du+9WkaSdjc8aJPZm+jMrqgo0tmfR+RcX5ZZ6H4=.sha256",
  "name": "enhancement",
  "issues": [
    "%eu+i7Un6uHDk6rGfspskRIJodQV1gQUuYryLvVeWtSA=.sha256"
  ]
}

Built with git-ssb-web