Welcome! Please see the About page for a little more info on how this works.

0 votes
in Meta by

`clojure
(defn my-cool-defn [])
`

in the above example i'm trying to tell the markdown engine that i want my code to be highlighted as clojure, but i get "clojure" being output as well. i am not sure my code is even in a code block, but it is formatted differently. is this a bug with this website?

1 Answer

+1 vote
by

In the editor, the top bar displays {} - select the code block and press that button to make that block properly formatted.

It's similar to StackOverflow - code blocks are distinguished by each line being indented with a few spaces on the left.

by
i have never done markdown code highlighting like that. i always use triple backquotes, on stack overflow as well. i just tried what you told me and i don't know how to tell it what language to highlight in

```clojure
(defn my-fn [])
```

the "clojure" part is confusing me a lot, where do i put that if all i do is indent?
by
I don't think the editor is configured to support that functionality. At the very least, I haven't been able to do it myself and I have never seen other people do it either.
by
ok, i thought i was just missing something because the highlighting sometimes happens and sometimes doesn't. when it does happen it doesn't really look right, either.
by
I don't see any "top bar in the editor".
I only get this plain `textarea` HTML element:

<textarea name="c14101_content" id="c14101_content" rows="4" cols="40" class="qa-form-tall-text">
...
</textarea>

I tried indenting with 4 spaces too, but no luck :(

Here is my entry:

https://ask.clojure.org/index.php/12115/ability-preserve-namespaces-clojure-named-using-clojure-write?show=14101#c14101
by
Unfortunately, comments work differently here, and are much more inferior when compared to questions and answers. It's one of the things on my list to fix (I'm not responsible for this website, Alex is, but I'm peeved enough by all such issues to improve it), I just never have the time to actually do it.
...