Commit d00bde4e authored by James Addison's avatar 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
......@@ -93,6 +93,11 @@ test('ignorePreformattedBlocks', () => {
expect(convertTimesToLocal(input, 1563387832493, 'Asia/Tokyo', 'en')).toEqual(input);
});
test('ignoreMultilineCodeBlocks', () => {
const input = '```test\none\ntwo\nthree\n2pm GMT tomorrow\ntest\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);
......
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment