debian-mirror-gitlab/app/assets/javascripts/notes/utils.js

20 lines
622 B
JavaScript
Raw Normal View History

2021-01-03 14:25:43 +05:30
/* eslint-disable @gitlab/require-i18n-strings */
2021-09-30 23:02:18 +05:30
import marked from 'marked';
import { sanitize } from '~/lib/dompurify';
import { markdownConfig } from '~/lib/utils/text_utility';
2021-01-03 14:25:43 +05:30
/**
* Tracks snowplow event when User toggles timeline view
* @param {Boolean} enabled that will be send as a property for the event
*/
2021-03-08 18:12:59 +05:30
export const trackToggleTimelineView = (enabled) => ({
2021-01-03 14:25:43 +05:30
category: 'Incident Management',
action: 'toggle_incident_comments_into_timeline_view',
label: 'Status',
property: enabled,
});
2021-09-30 23:02:18 +05:30
export const renderMarkdown = (rawMarkdown) => {
return sanitize(marked(rawMarkdown), markdownConfig);
};