Transform meta_description for persist.

@param  text  $meta_description
@param  text  $excerpt
@return text
978894
public function prepareMetaDescriptionForPersist($meta_description="", $excerpt)
    {
        if ($meta_description == "") return $excerpt;

        $meta_description = html_entity_decode($meta_description);
        $meta_description = strip_tags($meta_description);
        $meta_description = filter_var($meta_description, FILTER_SANITIZE_STRING);

        // remove the encoded blank chars
        $meta_description = str_replace("\xc2\xa0",'',$meta_description);

        $meta_description = trim($meta_description);
        return $meta_description;
    }
710929
def from_meta(cls, meta: "DocstringMeta") -> T.Any:
        """"""
        return cls(args=meta.args, description=meta.description)
1304094
public function teaser($text, $enable_filter = true, $filter_id = null)
    {
        $summary = '';

        if ($text !== '') {
            $parts = $this->explodeText($text);
            $summary = reset($parts);
        }

        if ($summary !== '' && $enable_filter) {
            $summary = $this->filter($summary, $filter_id);
        }

        return $summary;
    }
927877
public function setDescription($description)
    {
        $this->content = null;
        $this->parsedDescription = null;
        $this->description = trim($description);

        return $this;
    }
1132202
public static function transformCode(StreamMetaData $metadata): void
    {
        foreach (self::$transformers as $transformer) {
            $result = $transformer->transform($metadata);
            if ($result === SourceTransformer::RESULT_ABORTED) {
                break;
            }
        }
    }
912368
function mergeMeta( elem ) {
		var attr = elem.attribs,
			old = _.where( destChildren, {
				name: 'meta'
			} ),
			merged = false;

		[ 'charset', 'name', 'http-equiv' ].forEach( function( meta ) {
			if ( !attr[ meta ] ) {
				return;
			}

			old.forEach( function( el ) {
				var idx;

				if ( ( el.attribs[ meta ] === attr[ meta ] ) ||
					( meta === 'charset' && el.attribs[ meta ] ) ) {
					idx = destChildren.indexOf( el );
					utils.replaceElement( el, elem );
					destChildren[ idx ] = elem;
					merged = true;
				}
			} );
		} );

		return merged;
	}
571998
protected IModel<String> newDescription()
	{
		return ResourceModelFactory.newResourceModel(
			ResourceBundleKey.builder().key("page.meta.description").defaultValue("").build(),
			this);
	}
815169
protected function setMetas($title = null, $description = null)
    {
        $meta = Config::getInstance()->get('Eureka\Global\Meta');

        if ($title !== null) {
            $meta['title'] = strip_tags($title . ' - ' . $meta['title']);
        }

        if ($description !== null) {
            $meta['description'] = strip_tags($description);
        }

        Config::getInstance()->add('Eureka\Global\Meta', $meta);

        return $this;
    }
1368687
public function setMetaDescription($metaDescription, $locale = null)
    {
        $this->translate($locale, false)->setMetaDescription($metaDescription);
        $this->mergeNewTranslations();

        return $this;
    }
576241
public static function getHtmlFromExcerpt($excerpt)
    {
        $element = $excerpt['element'];
        $html = '<'.$element['name'];

        if (isset($element['attributes'])) {
            foreach ($element['attributes'] as $name => $value) {
                if ($value === null) {
                    continue;
                }
                $html .= ' '.$name.'="'.$value.'"';
            }
        }

        if (isset($element['text'])) {
            $html .= '>';
            $html .= $element['text'];
            $html .= '</'.$element['name'].'>';
        } else {
            $html .= ' />';
        }

        return $html;
    }
321737
public function getDescription()
    {
        $nodes = $this->html->findTags('meta');
        foreach ($nodes as $node) {
            if (strtolower($node->getAttribute('name')) == 'description') {
                return trim($node->getAttribute('content'));
            }
        }

        return null;
    }
93241
public function create(string $contents, ?TypeContext $context = null): Description
    {
        [$text, $tags] = $this->parse($this->lex($contents), $context);

        return new Description($text, $tags);
    }
1147929
function set_meta($meta_key, $meta_val) {
		return $this->edit_meta($meta_key, function($id, $key, $path) use ($meta_val) {
			$meta_val = yield $meta_val;
			if ( $path ) {
				# Patch -- XXX unserialize and count up?
				$old = static::_get_meta($id, $key);
				if ( $old === false ) $old = array();
				$traverser = new RecursiveDataStructureTraverser($old);
				while ( $path ) {
					if ( ! $traverser->exists($path[0]) )
						$traverser->insert($path[0], array());
					$traverser = $traverser->traverse_to(array($path[0]));
					array_shift($path);
				}
				$traverser->set_value($meta_val);
				$meta_val = $old;  # XXX reserialize and count down?
			}
			static::_set_meta($id, $key, $meta_val);
		});
	}
849577
protected function inlineIssueLink($excerpt)
    {
        if (preg_match('/([\p{L}\p{N}_-]*)\/?([\p{L}\p{N}_-]*)#(\d+)/ui', $excerpt['context'], $matches, PREG_OFFSET_CAPTURE)) {
            if (!empty($matches[1][0])) {
                $project = $matches[1][0] . '/' . $matches[2][0];
            } else {
                $project = $this->projectName;
            }
            $url = sprintf('%s/%s/issues/%s', $this->GitHub, $project, $matches[3][0]);

            $inline = array(
                'extent' => strlen($matches[0][0]),
                'position' => $matches[0][1],
                'element' => array(
                    'name' => 'a',
                    'text' => '#' . $matches[3][0],
                    'attributes' => array(
                        'href' => $url,
                    ),
                ),
            );
            
            return $inline;
        }
    }
947470
public void setInExcerpt(String excerpt) {

        setInExcerpt(Boolean.valueOf(String.valueOf(excerpt)).booleanValue());
    }
232934
private function excerpt(Post $post, int $count): string
    {
        $out = '';

        if ($this->posts->isContent()) {
            return $out;
        }

        $excerpt = $post->excerpt(
            $this->posts->args['excerpt']['length'],
            $this->posts->args['excerpt']['more_text']
        );

        if (!$excerpt) {
            return $out;
        }

        $out .= '<div '.$this->textOffset($post).
            ' class="entry-summary" itemprop="description">';
        $out .= $excerpt;
        $out .= '</div><!-- .entry-summary -->';

        return $out;
    }
1234356
public function editDescription(Description $description)
    {
        $this->guardNotDeleted();

        if ($description !== $this->description) {
            $this->apply(new DescriptionEdited($this->id, $description));
        }
    }