Paste image doesn't remove selected text
-
Copy an image into your clipboard, then in the post editor select some text and paste (Ctrl-V).
Expected result: the image markdown (
![...](...)
) replaces the selected text.
Actual result: the image is pasted before the text, which is still there.This text should disappear but it doesn't...
I suspect that this is actually just a more generic version of the issue described in this report, posted more than 3 years ago and still not fixed...
-
@remi This might qualify as surprising behaviour, but I could easily imagine it becoming the alt text instead.
-
The inability to Ctrl-Z image pasting:
-
@pie_flavor I think it's a wider inability of Ctrl-Z'ing any operation that creates markdown (or even HTML?). Clicking on the "abbr" button, for example, cannot be undone. Bolding/italicizing text, same thing. Although of course, from the developer's point of view, clicking a button in the editor's toolbar is not the same as pasting directly something (with Ctrl-V). But I would argue that from the user's point of view, they are the same (and they are both the same as pasting regular text, for which undo works as it should).
I suspect that NodeBB's editor has no specific undo at all, and that whatever limited undo we have is just the built-in undo of any text field in a browser?
But while it's definitely a missing feature (if not a bug), that's not quite the same as my bug report here.
-
@Zecc said in Paste image doesn't remove selected text:
@remi This might qualify as surprising behaviour, but I could easily imagine it becoming the alt text instead.
I could accept that, yes. Kind of like selecting text and clicking the hyperlink button turns the selected text into the link's text (same for abbr and other actions). I'm not sure people really want to use alt text that often (or even know that it exists!), so it would probably be surprising for a lot of people.
In any case, it should not do what it currently does...
-
@Zecc said in Paste image doesn't remove selected text:
@remi This might qualify as surprising behaviour, but I could easily imagine it becoming the alt text instead.
Does markdown even have the ability to generate alt text?
-
@PleegWat we can at least easily check how does it for xkcd?
@error_bot !xkcd random
-
xkcd said in https://xkcd.com/221/ :
Random Number
Â(via https://www.explainxkcd.com/wiki/index.php?search=random&title=Special%3ASearch&fulltext=1)
-
<img src="https://imgs.xkcd.com/comics/random_number.png" title="RFC 1149.5 specifies 4 as the standard IEEE-vetted random number."/>
No markdown. Doesn't mean it's unpossible, though, just that it's not how it's done here.
-
![This alt text won't be shown, but the attribute is there](https://imgs.xkcd.com/comics/random_number.png "RFC 1149.5 specifies 4 as the standard IEEE-vetted random number.")
-
@Zecc TIL that there are a
title
and analt
attribute on HTML<img>
tags, and that they aren't the same. Although it makes sense when thinking about it, but I guess that I just never did.TIAL that markdown can apparently do both.
-
@remi said in Paste image doesn't remove selected text:
I would argue that from the user's point of view, they are the same
More importantly, from a user's point of view, Ctrl+Z means undo the last operation, not "undo the last operation unless it was one of the magic operations in which case just ruin the text based on some calculation of character offsets"
-
@PleegWat said in Paste image doesn't remove selected text:
Does markdown even have the ability to generate alt text?
It does:
![alt text goes here](/assets/uploads/files/1571685069836-hopes.gif "title text here")
:
e:
-
@remi Hey, guess what Discourse does?
-
@pie_flavor said in Paste image doesn't remove selected text:
@remi Hey, guess what Discourse does?
Hey, even a blind squirrel finds a nut once in a while, but that doesn't mean he won't die of starvation.
-
@pie_flavor said in Paste image doesn't remove selected text:
@remi Hey, guess what Discourse does?
My guess: it replaces your entire post, because a picture says more than 1000 words.
Filed under: Don't ask a question if you won't like the answer
-
@JBert said in Paste image doesn't remove selected text:
a picture says more than 1000 words.
A hundred for you, a hundred for me, a hundred for @pie_flavor.
Now if only those were the same hundred words each time.
-
@pie_flavor said in Paste image doesn't remove selected text:
@remi Hey, guess what Discourse does?
Throw up 17 error messages? Show the MD5 hash of an asterisk?
502 OK
?
-
@pie_flavor said in Paste image doesn't remove selected text:
@remi Hey, guess what Discourse does?
It does something obviously useful and then subtly but intentionally hostile, eventually leading its users to a life of serial killing and telling people that they don't really like what they like and also are bad people for thinking they like stuff they don't really like.