Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
689538b5
Commit
689538b5
authored
Oct 05, 2020
by
Samantha Ming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure suggestion works for number text
Issue:
https://gitlab.com/gitlab-org/gitlab/-/issues/224143
parent
6da3c126
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
app/assets/javascripts/lib/utils/text_markdown.js
app/assets/javascripts/lib/utils/text_markdown.js
+1
-0
changelogs/unreleased/224143-suggestion-button-not-work-for-numbers.yml
...eleased/224143-suggestion-button-not-work-for-numbers.yml
+5
-0
spec/frontend/lib/utils/text_markdown_spec.js
spec/frontend/lib/utils/text_markdown_spec.js
+17
-0
No files found.
app/assets/javascripts/lib/utils/text_markdown.js
View file @
689538b5
...
...
@@ -166,6 +166,7 @@ export function insertMarkdownText({
let
editorSelectionEnd
;
let
lastNewLine
;
let
textToInsert
;
selected
=
selected
.
toString
();
if
(
editor
)
{
const
selectionRange
=
getEditorSelectionRange
(
editor
);
...
...
changelogs/unreleased/224143-suggestion-button-not-work-for-numbers.yml
0 → 100644
View file @
689538b5
---
title
:
Ensure suggestion works for number text
merge_request
:
44332
author
:
type
:
fixed
spec/frontend/lib/utils/text_markdown_spec.js
View file @
689538b5
...
...
@@ -13,6 +13,23 @@ describe('init markdown', () => {
textArea
.
parentNode
.
removeChild
(
textArea
);
});
describe
(
'
insertMarkdownText
'
,
()
=>
{
it
(
'
will not error if selected text is a number
'
,
()
=>
{
const
selected
=
2
;
insertMarkdownText
({
textArea
,
text
:
''
,
tag
:
''
,
blockTag
:
null
,
selected
,
wrap
:
false
,
});
expect
(
textArea
.
value
).
toBe
(
selected
.
toString
());
});
});
describe
(
'
textArea
'
,
()
=>
{
describe
(
'
without selection
'
,
()
=>
{
it
(
'
inserts the tag on an empty line
'
,
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment