Project

General

Profile

Revision 109968f7

ID109968f7f5bebb9505bbbf6e05e1fdc161c81f77
Parent 2228f46b
Child 6d9071b7

Added by Andreas Kohlbecker over 1 year ago

ref #7605 removing trailing space from tagged text markup

View differences:

modules/cdm_dataportal/cdm_api/cdm_api.module
247 247
  $tag = 'span';
248 248
  $out = '';
249 249
  $was_separator = false;
250
  $i = 0;
250 251
  foreach ($taggedtxt as $tt) {
251 252
    if (!in_array($tt->type, $skiptags) && $tt->text) {
252 253
      $class_attr = $tt->type;
......
254 255
      if(isset($tt->entityReference)){
255 256
        $class_attr .= " " . html_class_attribute_ref($tt->entityReference);
256 257
      }
258
      $is_last = $i + 1 == count($taggedtxt);
257 259
      $is_separator = is_tagged_text_sepatator_type($tt->type);
258
      $glue = !$is_separator && !$was_separator ? ' ' : '';
260
      $glue = !$is_separator && !$was_separator && !$is_last ? ' ' : '';
259 261
      $out .= '<' . $tag . ' class="' . $class_attr . '">'
260 262
        . t('@text', array('@text' => $tt->text))
261 263
        . '</' . $tag . '>'
262 264
        . $glue;
263 265
      $was_separator = $is_separator;
264 266
    }
267
    $i++;
265 268
  }
266 269
  return $out;
267 270
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)