debian-mirror-gitlab/app/assets/javascripts/issue_show/utils/parse_data.js

16 lines
371 B
JavaScript
Raw Normal View History

2019-07-07 11:18:12 +05:30
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 {};