You are here

private function FilterResponsiveTable::processTableCallback in Responsive Table Filter 8

Callback to replace content of the <table> elements.

Parameters

array $matches: An array of matches passed by preg_replace_callback().

Return value

string A formatted string.

File

src/Plugin/Filter/FilterResponsiveTable.php, line 81
Contains \Drupal\responsive_table_filter\Plugin\Filter\FilterResponsiveTable.

Class

FilterResponsiveTable
Provides a filter that wraps <table> tags with a <figure> tag.

Namespace

Drupal\responsive_table_filter\Plugin\Filter

Code

private function processTableCallback(array $matches) {
  $attributes = $matches[1];
  $text = $matches[2];
  $text = '<' . $this
    ->getWrapperElement() . $this
    ->getWrapperAttributes() . '><table' . $attributes . '>' . $text . '</table></' . $this
    ->getWrapperElement() . '>';
  return $text;
}