Revision 109968f7
Added by Andreas Kohlbecker almost 4 years ago
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
ref #7605 removing trailing space from tagged text markup