rawphp/plugged-in

View on GitHub
examples/plugin/src/removeLinks.js

Summary

Maintainability
A
0 mins
Test Coverage
/**
 * Removes links from the body.
 *
 * @param {Event} event the event
 *
 * @returns {undefined}
 */
export default async function removeLinks(event) {
  const app = event.context;

  const body = app.body.replace(/<a\b[^>]*>(.*?)<\/a>/i, '');

  app.body = body;
}