You are here

function shortcode_basic_tags_shortcode_highlight in Shortcode 7

Same name and namespace in other branches
  1. 6 shortcode_basic_tags/shortcode_basic_tags.module \shortcode_basic_tags_shortcode_highlight()
  2. 7.2 shortcode_basic_tags/shortcode_basic_tags.module \shortcode_basic_tags_shortcode_highlight()

Insert a span around the text with highlight css class

Calling [highlight]text[/highlight]

If the length empty or invalid, between 1-99, the length will be 8

File

shortcode_basic_tags/shortcode_basic_tags.module, line 80

Code

function shortcode_basic_tags_shortcode_highlight($attrs, $text) {
  extract(shortcode_attrs(array(
    'class' => '',
  ), $attrs));
  $class = shortcode_add_class($class, 'highlight');
  return '<span class="' . $class . '">' . $text . '</span>';
}