-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(markdown): add image button [KHCP-12213] #88
feat(markdown): add image button [KHCP-12213] #88
Conversation
|
src/types/markdown-ui.ts
Outdated
| 'link' | ||
| 'image' |
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.
nit: formatting
| 'link' | |
| 'image' | |
| 'link' | |
| 'image' |
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.
updated
textarea.selectionStart = startText.length + selectedText.text.length + 3 | ||
textarea.selectionEnd = startText.length + selectedText.text.length + 6 |
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.
issue: these need to be increased by 1
textarea.selectionStart = startText.length + selectedText.text.length + 3 | |
textarea.selectionEnd = startText.length + selectedText.text.length + 6 | |
textarea.selectionStart = startText.length + selectedText.text.length + 4 | |
textarea.selectionEnd = startText.length + selectedText.text.length + 7 |
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.
fixed
} | ||
|
||
// Prepare the content | ||
newContent = MARKDOWN_TEMPLATE_IMAGE.replace(/alt/, '') |
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.
suggestion: let's not remove the alt
text so it's obvious what it is. Can you make the same change on line 472
so that the link
is now this: newContent = MARKDOWN_TEMPLATE_LINK
newContent = MARKDOWN_TEMPLATE_IMAGE.replace(/alt/, '') | |
newContent = MARKDOWN_TEMPLATE_IMAGE |
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.
changed
// Prepare the content | ||
newContent = MARKDOWN_TEMPLATE_IMAGE.replace(/alt/, '') | ||
|
||
let cursorPosition = 4 |
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.
This should be 2
let cursorPosition = 4 | |
let cursorPosition = 2 |
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.
updated
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.
lgtm
# [1.7.0](v1.6.2...v1.7.0) (2024-06-18) ### Features * **markdown:** add image button [KHCP-12213] ([#88](#88)) ([4cbc61b](4cbc61b))
🎉 This PR is included in version 1.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
https://konghq.atlassian.net/browse/KHCP-12213