Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tools
mattermost
mattermost-plugin-walltime
Commits
d00bde4e
Commit
d00bde4e
authored
Jan 05, 2022
by
James Addison
Browse files
Merge branch 'issue-25/ignore-preformatted-code-blocks' into deploys/test-20220105
parents
fcac3c7f
70aaf0fd
Pipeline
#35297
passed with stages
in 21 minutes and 36 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
webapp/src/test.js
View file @
d00bde4e
...
...
@@ -93,6 +93,11 @@ test('ignorePreformattedBlocks', () => {
expect
(
convertTimesToLocal
(
input
,
1563387832493
,
'
Asia/Tokyo
'
,
'
en
'
)).
toEqual
(
input
);
});
test
(
'
ignoreMultilineCodeBlocks
'
,
()
=>
{
const
input
=
'
```test
\n
one
\n
two
\n
three
\n
2pm GMT tomorrow
\n
test
\n
```
'
;
expect
(
convertTimesToLocal
(
input
,
1563387832493
,
'
Asia/Tokyo
'
,
'
en
'
)).
toEqual
(
input
);
});
test
(
'
ignoreHyperlinks
'
,
()
=>
{
const
input
=
'
https://example.com/directory/test-2022-0900 is not a timestamp
'
;
expect
(
convertTimesToLocal
(
input
,
1563387832493
,
'
Asia/Tokyo
'
,
'
en
'
)).
toEqual
(
input
);
...
...
webapp/src/time.js
View file @
d00bde4e
...
...
@@ -14,6 +14,7 @@ chrono.casual.parsers = chrono.casual.parsers.filter((parser) => {
export
function
convertTimesToLocal
(
message
,
messageCreationTime
,
localTimezone
,
locale
)
{
const
filterRenderer
=
new
marked
.
Renderer
();
filterRenderer
.
code
=
()
=>
''
;
filterRenderer
.
codespan
=
()
=>
''
;
filterRenderer
.
link
=
()
=>
''
;
filterRenderer
.
paragraph
=
(
text
)
=>
text
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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