1

Have a look at these comments containing some inline code.

The highlighting of the inline code incorrectly encloses the normal text space after the trailing `.

This seems to be some mistake in the CSS definition.

| |
  • Almost there! I have got now onoremap <expr> i$ col('.') == 1 ? ":<C-U>normal! lvt$<CR>" : ":<C-U>normal! hET$v,<CR>" and I am wondering whether one can extend the test for the character under the cursor at the beginning of the line; i.e. something like == 1 && char(col(':')) == "$" I find it hard to find the pertaining documentation for these tests. – Serge Stroobandt May 5 at 14:51
  • As shown above, I cannot reproduce the bug here in Meta. – Serge Stroobandt May 5 at 14:57
  • The weird thing is, it does not work at the beginning of the line with the almost identical mapping onoremap <expr> i$ col('.') == 1 ? "f$" : ":<C-U>normal! hEF$lv,h<CR>" Help would be much appreciated! – filbranden May 5 at 15:02
  • 1
    ^^ That's same text of your comment from that answer. It looks like there's a newline character there just before the last `. – filbranden May 5 at 15:05
  • 1
    The weird thing is, it does not work at the beginning of the line with the almost identical mapping onoremap <expr> i$ col('.') == 1 ? "f$" : ":<C-U>normal! hEF$lv,h<CR>" Help would be much appreciated! (Removed newline character.) – filbranden May 5 at 15:05
  • @filbranden Cleverly seen! That newline must have slipped in when copying the code. Evidently, Vim scripting is driving me crazy! ;-) – Serge Stroobandt May 5 at 15:13
  • 1
    The odd thing is that after removing the newline character I still see the same... – filbranden May 5 at 15:14
  • @filbranden The other thing I did notice is that ` == 1 && char(col(':')) == "$"` does not work when ` is immediately followed by a space. However, that could be a Markdown thing. – Serge Stroobandt May 5 at 15:15
4

TL;DR backticks are always weird

But this is the type of thing that should be discussed on meta.stackexchange.com, not here. We can't change the markdown processing here. On SE can do that, and they need to know about it. (That said, I suspect a search on meta.SE will turn up many results on this.)


As filbranden and I independently noticed, there is extra whitespace within the backticks:

The weird thing is, it does not work at the beginning of the line with the almost identical mapping `onoremap <expr> i$ col('.') == 1 ? "f$" : ":<C-U>normal! hEF$lv,h<CR>"
` Help would be much appreciated!
Almost there! I have got now `onoremap <expr> i$ col('.') == 1 ? ":<C-U>normal! lvt$<CR>" : ":<C-U>normal! hET$v,<CR>"
` and I am wondering whether one can extend the test for the character under the cursor at the beginning of the line; i.e. something like ` == 1 && char(col(':')) == "$"` I find it hard to find the pertaining documentation for these tests.

In both cases it's a newline that causes this problem.

Other experiments

And yes, following a backtick with a space ` causes it to appear on its own.

However, <here is one and here's another> with the same spacing renders...

And trying to get a backtick in code formatting: ``` is atrocious. ``` with a \ escape doesn't work either. And it always messes up formatting for the rest of the paragraph...

<code> tags and <pre> tags work the best:

This is a backtick: ` but it still messes up if there's more than one:

Backtick </code> backtick <code>.

| |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .