Skip to content
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

Conversation

DariaYeremina
Copy link
Contributor

@DariaYeremina DariaYeremina self-assigned this Jun 18, 2024
@DariaYeremina DariaYeremina requested review from adamdehaven, jillztom and a team as code owners June 18, 2024 14:19
@CLAassistant
Copy link

CLAassistant commented Jun 18, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Comment on lines 22 to 23
| 'link'
| 'image'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: formatting

Suggested change
| 'link'
| 'image'
| 'link'
| 'image'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Comment on lines 541 to 542
textarea.selectionStart = startText.length + selectedText.text.length + 3
textarea.selectionEnd = startText.length + selectedText.text.length + 6
Copy link
Member

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

Suggested change
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

Copy link
Contributor Author

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/, '')
Copy link
Member

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

Suggested change
newContent = MARKDOWN_TEMPLATE_IMAGE.replace(/alt/, '')
newContent = MARKDOWN_TEMPLATE_IMAGE

Copy link
Contributor Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be 2

Suggested change
let cursorPosition = 4
let cursorPosition = 2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Copy link
Member

@adamdehaven adamdehaven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@DariaYeremina DariaYeremina merged commit 4cbc61b into main Jun 18, 2024
4 checks passed
@DariaYeremina DariaYeremina deleted the feat/KHCP-12213-create-add-image-from-url-icon-in-markdown-renderer-tooltip branch June 18, 2024 18:49
kongponents-bot pushed a commit that referenced this pull request Jun 18, 2024
# [1.7.0](v1.6.2...v1.7.0) (2024-06-18)

### Features

* **markdown:** add image button [KHCP-12213] ([#88](#88)) ([4cbc61b](4cbc61b))
@kongponents-bot
Copy link
Collaborator

🎉 This PR is included in version 1.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants