Commit 5b0e232c authored by Tim Zallmann's avatar Tim Zallmann

Fixes the repainting problem on the issue page

parent 4d8bc1ac
import { sanitize } from 'dompurify';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import updateDescription from '../utils/update_description';
......@@ -27,8 +28,8 @@ export default class Store {
const details =
descriptionSection != null && descriptionSection.getElementsByTagName('details');
this.state.descriptionHtml = updateDescription(data.description, details);
this.state.titleHtml = data.title;
this.state.descriptionHtml = updateDescription(sanitize(data.description), details);
this.state.titleHtml = sanitize(data.title);
this.state.lock_version = data.lock_version;
}
......
import { sanitize } from 'dompurify';
// We currently load + parse the data from the issue app and related merge request
let cachedParsedData;
export const parseIssuableData = () => {
try {
if (cachedParsedData) return cachedParsedData;
const initialDataEl = document.getElementById('js-issuable-app-initial-data');
const parsedData = JSON.parse(initialDataEl.textContent.replace(/"/g, '"'));
......@@ -9,6 +14,8 @@ export const parseIssuableData = () => {
parsedData.initialTitleHtml = sanitize(parsedData.initialTitleHtml);
parsedData.initialDescriptionHtml = sanitize(parsedData.initialDescriptionHtml);
cachedParsedData = parsedData;
return parsedData;
} catch (e) {
console.error(e); // eslint-disable-line no-console
......
Markdown is supported
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