ChrisMorgan asked this question · 6 karma ·

This is the result I want to achieve, in HTML form (this site doesn't support inline code formatting?):

The <code>cat</code>s sat on the <code>mat</code>.

I'm using the default formatting format. Here are the things I have tried, and what they result in:

The {{cat}}s sat on the {{mat}}.
The {{cat}}\s sat on the {{mat}}.
The {{cat}}\ s sat on the {{mat}}.
The {{cat}} s sat on the {{mat}}.
The {{cat}}​s sat on the {{mat}}. [Note the zero-width space between the {{cat}} and the s.]
The {{cat}}­s sat on the {{mat}}. [This time, it's a soft hyphen.]

Their results:

The <code>cat}}s sat on the {{mat</code>.
The <code>cat</code>\s sat on the <code>mat</code>.
The <code>cat</code>\ s sat on the <code>mat</code>.
The <code>cat</code> s sat on the <code>mat</code>.
The <code>cat</code>​s sat on the <code>mat</code>. [Yep, zero-width space is there.]
The <code>cat</code>­s sat on the <code>mat</code>. [The &shy; is in there.]

Of these, only the zero-width space and soft hyphen techniques works correctly, and these are naturally a Right Pain to Use.

Is there a better way?

94 views