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
ed226820
Commit
ed226820
authored
Jun 13, 2021
by
Himanshu Kapoor
Committed by
David O'Regan
Jun 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for strikethrough in content editor
parent
98a555f4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
1 deletion
+27
-1
app/assets/javascripts/content_editor/components/top_toolbar.vue
...ets/javascripts/content_editor/components/top_toolbar.vue
+9
-0
app/assets/javascripts/content_editor/extensions/strike.js
app/assets/javascripts/content_editor/extensions/strike.js
+9
-0
app/assets/javascripts/content_editor/services/create_content_editor.js
...ascripts/content_editor/services/create_content_editor.js
+2
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/frontend/content_editor/components/top_toolbar_spec.js
spec/frontend/content_editor/components/top_toolbar_spec.js
+1
-0
spec/frontend/fixtures/api_markdown.yml
spec/frontend/fixtures/api_markdown.yml
+3
-1
No files found.
app/assets/javascripts/content_editor/components/top_toolbar.vue
View file @
ed226820
...
...
@@ -63,6 +63,15 @@ export default {
:tiptap-editor=
"contentEditor.tiptapEditor"
@
execute=
"trackToolbarControlExecution"
/>
<toolbar-button
data-testid=
"strike"
content-type=
"strike"
icon-name=
"strikethrough"
editor-command=
"toggleStrike"
:label=
"__('Strikethrough')"
:tiptap-editor=
"contentEditor.tiptapEditor"
@
execute=
"trackToolbarControlExecution"
/>
<toolbar-button
data-testid=
"code"
content-type=
"code"
...
...
app/assets/javascripts/content_editor/extensions/strike.js
0 → 100644
View file @
ed226820
import
{
Strike
}
from
'
@tiptap/extension-strike
'
;
export
const
tiptapExtension
=
Strike
;
export
const
serializer
=
{
open
:
'
~~
'
,
close
:
'
~~
'
,
mixable
:
true
,
expelEnclosingWhitespace
:
true
,
};
app/assets/javascripts/content_editor/services/create_content_editor.js
View file @
ed226820
...
...
@@ -19,6 +19,7 @@ import * as Link from '../extensions/link';
import
*
as
ListItem
from
'
../extensions/list_item
'
;
import
*
as
OrderedList
from
'
../extensions/ordered_list
'
;
import
*
as
Paragraph
from
'
../extensions/paragraph
'
;
import
*
as
Strike
from
'
../extensions/strike
'
;
import
*
as
Text
from
'
../extensions/text
'
;
import
buildSerializerConfig
from
'
./build_serializer_config
'
;
import
{
ContentEditor
}
from
'
./content_editor
'
;
...
...
@@ -44,6 +45,7 @@ const builtInContentEditorExtensions = [
ListItem
,
OrderedList
,
Paragraph
,
Strike
,
Text
,
];
...
...
locale/gitlab.pot
View file @
ed226820
...
...
@@ -31227,6 +31227,9 @@ msgstr ""
msgid "StorageSize|Unknown"
msgstr ""
msgid "Strikethrough"
msgstr ""
msgid "Subgroup information"
msgstr ""
...
...
spec/frontend/content_editor/components/top_toolbar_spec.js
View file @
ed226820
...
...
@@ -42,6 +42,7 @@ describe('content_editor/components/top_toolbar', () => {
testId | controlProps
${
'
bold
'
}
|
${{
contentType
:
'
bold
'
,
iconName
:
'
bold
'
,
label
:
'
Bold text
'
,
editorCommand
:
'
toggleBold
'
}
}
${
'
italic
'
}
|
${{
contentType
:
'
italic
'
,
iconName
:
'
italic
'
,
label
:
'
Italic text
'
,
editorCommand
:
'
toggleItalic
'
}
}
${
'
strike
'
}
|
${{
contentType
:
'
strike
'
,
iconName
:
'
strikethrough
'
,
label
:
'
Strikethrough
'
,
editorCommand
:
'
toggleStrike
'
}
}
${
'
code
'
}
|
${{
contentType
:
'
code
'
,
iconName
:
'
code
'
,
label
:
'
Code
'
,
editorCommand
:
'
toggleCode
'
}
}
${
'
blockquote
'
}
|
${{
contentType
:
'
blockquote
'
,
iconName
:
'
quote
'
,
label
:
'
Insert a quote
'
,
editorCommand
:
'
toggleBlockquote
'
}
}
${
'
bullet-list
'
}
|
${{
contentType
:
'
bulletList
'
,
iconName
:
'
list-bulleted
'
,
label
:
'
Add a bullet list
'
,
editorCommand
:
'
toggleBulletList
'
}
}
...
...
spec/frontend/fixtures/api_markdown.yml
View file @
ed226820
# This data file drives the specs in
# spec/frontend/fixtures/api_markdown.rb and
# spec/frontend/
rich_tex
t_editor/extensions/markdown_processing_spec.js
# spec/frontend/
conten
t_editor/extensions/markdown_processing_spec.js
---
-
name
:
bold
markdown
:
'
**bold**'
...
...
@@ -8,6 +8,8 @@
markdown
:
'
_emphasized
text_'
-
name
:
inline_code
markdown
:
'
`code`'
-
name
:
strike
markdown
:
'
~~del~~'
-
name
:
link
markdown
:
'
[GitLab](https://gitlab.com)'
-
name
:
code_block
...
...
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