Page MenuHomePhabricator

Disable the {{ (template) sequence when inside a <code> annotation
Open, Needs TriagePublic

Description

I wanted to type the following in VE:

Screenshot from 2020-02-14 16-32-06.png (28×644 px, 7 KB)

(the wikitext equivalent of this is This is because template interpolations (<code><nowiki>{{variable}}</nowiki></code> syntax) can only return plain text,)

When I typed this out, I hit Ctrl+Shift+6 to enable <code> styling, then typed {{variable}}, and I was surprised to see the template dialog open up. This kind of makes sense, because I triggered the {{ sequence, but when I'm typing inside a <code> context I probably want to type a literal {{, not a template.

It would be nice if there was a way for the {{ sequence (and similar sequences) not to be triggered when the <code> annotation is active.

Event Timeline

Sometimes templates are used inside <code>, see https://en.wikipedia.org/w/index.php?search=insource%3A%2F\%3Ccode\%3E\{\{%2F I think it's easier to just type Ctrl+Shift+6, {, {, Esc in your case then to prevent users from using the template dialog when they really do want to put a template inside code.