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
70aec343
Commit
70aec343
authored
Aug 06, 2020
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly turn off markdown keydown listener
for specific text area
parent
f0402e3f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
app/assets/javascripts/lib/utils/text_markdown.js
app/assets/javascripts/lib/utils/text_markdown.js
+2
-3
changelogs/unreleased/bw-surround-text-wth-char.yml
changelogs/unreleased/bw-surround-text-wth-char.yml
+1
-1
spec/features/projects/wiki/markdown_preview_spec.rb
spec/features/projects/wiki/markdown_preview_spec.rb
+1
-0
No files found.
app/assets/javascripts/lib/utils/text_markdown.js
View file @
70aec343
...
...
@@ -332,13 +332,12 @@ export function keypressNoteText(e) {
select
:
''
,
tagContent
:
''
,
});
}
}
/* eslint-enable @gitlab/require-i18n-strings */
export
function
addMarkdownListeners
(
form
)
{
$
(
'
.markdown-area
'
).
on
(
'
keydown
'
,
keypressNoteText
);
$
(
'
.markdown-area
'
,
form
).
on
(
'
keydown
'
,
keypressNoteText
);
return
$
(
'
.js-md
'
,
form
)
.
off
(
'
click
'
)
.
on
(
'
click
'
,
function
()
{
...
...
@@ -377,6 +376,6 @@ export function addEditorMarkdownListeners(editor) {
}
export
function
removeMarkdownListeners
(
form
)
{
$
(
'
.markdown-area
'
).
off
(
'
keydown
'
);
$
(
'
.markdown-area
'
,
form
).
off
(
'
keydown
'
,
keypressNoteText
);
return
$
(
'
.js-md
'
,
form
).
off
(
'
click
'
);
}
changelogs/unreleased/bw-surround-text-wth-char.yml
View file @
70aec343
---
title
:
Surround selected text in markdown fields on certain key presses
merge_request
:
25748
merge_request
:
37151
author
:
type
:
added
spec/features/projects/wiki/markdown_preview_spec.rb
View file @
70aec343
...
...
@@ -8,6 +8,7 @@ RSpec.describe 'Projects > Wiki > User previews markdown changes', :js do
let
(
:wiki_page
)
{
create
(
:wiki_page
,
wiki:
project
.
wiki
,
title:
'home'
,
content:
'[some link](other-page)'
)
}
let
(
:wiki_content
)
do
<<-
HEREDOC
Some text so key event for [ does not trigger an incorrect replacement.
[regular link](regular)
[relative link 1](../relative)
[relative link 2](./relative)
...
...
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