debian-mirror-gitlab/app/assets/javascripts/issue_show/utils/parse_data.js
2019-07-07 11:18:12 +05:30

15 lines
371 B
JavaScript

import sanitize from 'sanitize-html';
export const parseIssuableData = () => {
try {
const initialDataEl = document.getElementById('js-issuable-app-initial-data');
return JSON.parse(sanitize(initialDataEl.textContent).replace(/"/g, '"'));
} catch (e) {
console.error(e); // eslint-disable-line no-console
return {};
}
};
export default {};