gitlab-org--gitlab-foss/app/assets/javascripts/issue_show/utils/parse_data.js
Fatih Acet 7650677d3d
Rewrite related MRs widget with Vue
This MR rewrites existing Related Merge Requests widget
with Vue with reusing shared Related Issues components
2019-04-05 21:20:28 +02:00

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 {};