export default (data) => {
  let newData = data;
  [...newData.matchAll(/!hugo\(\)/g)].forEach((match) => {
    newData = newData.replace(
      match[0],
      `<div class="crt">
        <div class="scanlines"></div>
        <canvas
          id="hugo-canvas"
          width="320"
          height="200"
          oncontextmenu="event.preventDefault()"
        >
        </canvas>
      </div>`,
    );
  });
  return newData;
};
