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
75affd91
Commit
75affd91
authored
Aug 23, 2021
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'ph/333351/fixSuggestionsNewLines' into 'master'"
This reverts merge request !68532
parent
31462b14
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
20 deletions
+1
-20
app/assets/javascripts/lib/utils/text_markdown.js
app/assets/javascripts/lib/utils/text_markdown.js
+1
-1
spec/frontend/lib/utils/text_markdown_spec.js
spec/frontend/lib/utils/text_markdown_spec.js
+0
-19
No files found.
app/assets/javascripts/lib/utils/text_markdown.js
View file @
75affd91
...
...
@@ -232,7 +232,7 @@ export function insertMarkdownText({
.
join
(
'
\n
'
);
}
}
else
if
(
tag
.
indexOf
(
textPlaceholder
)
>
-
1
)
{
textToInsert
=
tag
.
replace
(
textPlaceholder
,
()
=>
selected
);
textToInsert
=
tag
.
replace
(
textPlaceholder
,
()
=>
selected
.
replace
(
/
\\
n/g
,
'
\n
'
)
);
}
else
{
textToInsert
=
String
(
startChar
)
+
tag
+
selected
+
(
wrap
?
tag
:
''
);
}
...
...
spec/frontend/lib/utils/text_markdown_spec.js
View file @
75affd91
...
...
@@ -70,25 +70,6 @@ describe('init markdown', () => {
expect
(
textArea
.
value
).
toContain
(
'
# Does not parse the `$` currently.
'
);
});
it
(
'
inserts a new line correctly
'
,
()
=>
{
const
initialValue
=
''
;
textArea
.
value
=
initialValue
;
textArea
.
selectionStart
=
0
;
textArea
.
selectionEnd
=
0
;
insertMarkdownText
({
textArea
,
text
:
textArea
.
value
,
tag
:
'
```suggestion:-0+0
\n
{text}
\n
```
'
,
blockTag
:
true
,
selected
:
'
# Does not parse the
\\
n currently.
'
,
wrap
:
false
,
});
expect
(
textArea
.
value
).
toContain
(
'
# Does not parse the
\\
n currently.
'
);
});
it
(
'
inserts the tag on a new line if the current one is not empty
'
,
()
=>
{
const
initialValue
=
'
some text
'
;
...
...
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