New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes cursor position to end of inserted image syntax, implements #2079 #2106
Conversation
…eep open' mode)
@rsynnest, thanks for your PR! By analyzing the history of the files in this pull request, we identified @selfthinker, @adrianheine and @akate to be potential reviewers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code works well and looks good, but I have some advice in hand.
lib/scripts/media.js
Outdated
|
||
insertTags(edid, '{{' + alignleft + mediaid + opts + alignright + '|', '}}', ''); | ||
if (keepopen) { | ||
insertTags(edid, '{{' + alignleft + mediaid + opts + alignright + '|}}', '', ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think after the tag we can add \n\n
for better composition. That is:
insertTags(edid, '{{' + alignleft + mediaid + opts + alignright + "|}}\n\n", '', '');
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would disagree. I often use the feature to insert multiple images into one article but not necessarily one after each other. More like "one here, on there and another there..." having it insert new paragraphs would be counter productive then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@splitbrain is right. I ignored this use case before.
I would like that if the media manager includes just one image (or the latest if you include a couple of images), that it puts the cursor in the just included syntax (the behaviour before this change). My proposal is to check if the cursor is already in a syntax (that is checking if |
sure thing, will push an update soon |
…ady inside an image tag If it's already inside an image tag, move the cursor to the end of the current tag.
good work. Thanks a lot @rsynnest 👍 |
Changes cursor position to end of text if media manager is in 'keep open' mode for adding multiple images (Issue #2079).