Formatting behaviour in iNat comments

[On PC - Chrome]
In discourse forum, when applying formatting you can < ctr-shift arrow> to highlight to the end of a word, or more precisely, to the start of the next eg:

image

(notice the space is highlighted at the end after perennis)

Then when you apply a formatting, such as italic, it places the terminating markup before the space eg:

image

in the editing of comments in iNat observations, this behaviour is different and problematic. It places the terminating markup after the space and adjacent to the next word, which breaks how the markup is applied…

make the selection using < ctrl-shift arrow> twice:
image

apply formatting (italic):
image

resulting comment:
image

currently have to remember to < shift leftarrow> to remove the space from the selection prior to applying the formatting, which is not ideal.

When there is a punctuation mark, eg comma or period, then the highlighting does stop at the end of the word so it’s not an issue, it’s only when there is a space included at the end of the hightlighted text.

1 Like

I don’t have this issue. Although for me the keyboard shortcut is option-shift-arrow (on a Mac). ctrl-shift-arrow does the whole row.

maybe it’s just a Chrome thing…

Hm I’m also using Chrome…

I didn’t know about this keyboard shortcut! I always just double click and drag.

Can’t replicate in both FF and Chrome on my Macbook, the selection doesn’t include the space after the word.

maybe a Windows/Chrome thing? I’ve turned off my plugins just in case that was interefering, but it still does it…
image

I have a USB wireless keyboard, which I plug into my Panasonic Toughpad… could that have an effect?

On Linux, Ctrl+Shift+Left/Right selects to the beginning and end of words, which is pretty standard behaviour for all edit controls in all applications. Have you tried it in any other Windows applications to see if you get the same behaviour? If so, that would suggest it’s a platform-specific thing. If not, maybe it’s a bug in the particular Windows version of Chrome you are using.

As for the italics button in iNat comments: the auto-fixing of spaces seems more like a missing feature than a bug. The markdown language doesn’t allow spaces between the asterisks and the enclosed text, so the current behaviour is strictly correct, but inconvenient.

1 Like

yup.

yeah. ctrl + right seems to get you to the beginning of the next word or the next punctuation mark in Chrome and other Windows applications (ex. Word, Notepad).

what about instead of starting from the beginning and ctrl + right, start from the end and ctrl + left?

or what i tend to do is type **, then left arrow in between the asterisks, then type what i want to be italicized, then right arrow out (or end) to type the rest of what i want to type. (i often do something similar for parentheses, quotes, etc., since that helps me make sure i close things properly.)

1 Like

actually, I still have a massive habit of using html tags to do italics. When I consciously try to remember to use the new markdown, I find that I am so focused on that (and what I’m trying to say) that I forget to make sure it’s right before saving the comment, and it’s only when I see the messed up formatting that I remember it.

It can’t just be a windows/chrome thing, because in this forum it is working fine and I access both via windows and chrome. Discourse ctrl-shift-right highlights to the start of the next word (ie includes the space after the selected word), but when I apply the italics it removes the space from the selection.

ctrl-shift-right from beginning of word:
image

and ctrl-i to apply italics:
image

yup, as bazwal noted, it looks like Discourse has an extra feature to ignore trailing spaces when adding the trailing asterisk, but…