Suppose I have the following code:
(lambda (x) (+ x 1))
I would like to display it as follows without changing what actually gets copied:
(λ (x) (+ x 1))
The goal is to achieve the effect of Emacs prettify-symbols-mode. This question shows how to hide some text and display something else, but display:nonenot copied, at least in Firefox.
In other words, how can I display lists of remote source codes without violating copy-paste? Bonus points for pure HTML + CSS.
The best I could come up with is the following:
.lambda:after {
content:"λ";
}
(<span>
<span style="position:absolute;left:-3000px;">lambda</span>
<span class="lambda"></span>
</span> x (+ x 1))
Is this the right approach?
source
share